Documentation ¶
Index ¶
- Constants
- func Start() (*DDPConn, *DDPConn)
- func StartWithFixtures(fixtures helpers.DBData) (*DDPConn, *DDPConn)
- func Stop()
- type DDPConn
- type DDPData
- type DDPMsg
- func DDPAdded(collection, id string, fields DDPData) *DDPMsg
- func DDPChanged(collection, id string, fields DDPData, cleared []string) *DDPMsg
- func DDPMethod(id, method string, params ...interface{}) *DDPMsg
- func DDPReady(id string) *DDPMsg
- func DDPRemoved(collection, id string) *DDPMsg
- func DDPResult(id string, result DDPData) *DDPMsg
- func DDPSub(id, name string, params ...interface{}) *DDPMsg
- func DDPUpdated(methods []string) *DDPMsg
- type DDPMsgGroup
Constants ¶
const DDPFirstRandomID = "vQrh9EH6JAa437k35"
DDPFirstRandomID is the first ID the server will pick, given DDPRandomSeed
const DDPRandomSeed = "someseed"
DDPRandomSeed is the seed we send to Meteor with method calls
Variables ¶
This section is empty.
Functions ¶
func StartWithFixtures ¶
StartWithFixtures is like Start, but seeds the Mongo DB with a given set of records
Types ¶
type DDPConn ¶
type DDPConn struct {
// contains filtered or unexported fields
}
DDPConn represents a connection to a Meteor server. It allows you to send messages, and make assertions about the messages that are sent back
func (*DDPConn) ClearReceiveBuffer ¶
func (conn *DDPConn) ClearReceiveBuffer()
ClearReceiveBuffer clears the buffer of messages that will be compared on the next call to VerifyReceive. It doesn't return until no message have been received for 3 seconds.
func (*DDPConn) VerifyReceive ¶
func (conn *DDPConn) VerifyReceive(t *testing.T, expectedMessageGroups ...DDPMsgGroup)
VerifyReceive reads messages from the Meteor server until no messages have been received for 3 seconds, and then checks that the received messages match the expected messages.
VerifyReceive takes an arbitrary number of "message groups". When checking against the received messages, messages within a single group can be in any order.
For example, if we specify our expected groups as [(a b), (c d), (e)], then (b a d c e) would be OK, but (a c b d e), (a b c d), and (a b c d e f) would not be OK.
type DDPMsg ¶
DDPMsg represents a single message sent to or received from a Meteor server
func DDPChanged ¶
DDPChanged constructs a DDP changed message
func DDPRemoved ¶
DDPRemoved constructs a DDP removed message
func DDPUpdated ¶
DDPUpdated constructs a DDP updated message