based/testing
Types
A mock connection
pub type Connection {
Connection(Subject(Message))
}
Constructors
-
Connection(Subject(Message))
pub type Message {
Shutdown
Insert(State)
Get(
reply_with: Subject(Result(List(Dynamic), BasedError)),
key: String,
)
}
Constructors
-
Shutdown
-
Insert(State)
-
Get( reply_with: Subject(Result(List(Dynamic), BasedError)), key: String, )
Functions
pub fn empty_returns_for(queries: List(Query)) -> State
pub fn mock_adapter(
state: State,
) -> BasedAdapter(State, Connection, a)
pub fn mock_service(
query: Query,
conn: Connection,
) -> Result(List(Dynamic), BasedError)
pub fn with_connection(
state: State,
callback: fn(Connection) -> a,
) -> a
For testing code without hitting a real database