Skip to main content

Module test_support

Module test_support 

Source
Expand description

In-memory connections a test can play the server on, and a made-up protocol that stamps everything it encodes so a test can tell which protocol the client settled on. Behind the test-support feature, for this crate’s own tests and for the tests of anything built on it.

Everything here panics rather than returning an error: a test that can’t have what it asked for has nothing left to assert.

Structs§

FakeConn
The server’s end of one connection. Like Rails it keeps the identifiers it has confirmed and ignores a second subscribe for one of them, so a test reads off the wire exactly what a Rails server would act on, in the order the test acts on it.
FakeProtocol
Speaks a made-up subprotocol and stamps everything it encodes, so a test can tell which protocol the client settled on.
FakeTransport
A transport whose connections a test accepts and plays the server on.
SentCommand
A command as the client wrote it.

Constants§

WAIT
How long a test will hang around for something that should already have happened.

Functions§

quote
value as a JSON string literal, for building frames by hand.