Documentation
¶
Overview ¶
Package hooktest is the test rig of the hook record: a hook.Store over a miniredis reached through net.Pipe, so no TCP connection is made (the cleanup fails a test whose fake took one), on a clock that moves only when a test moves it. Every tool that gates on the hook tests its gate on it.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Rig ¶
type Rig struct {
MR *miniredis.Miniredis
Client *redis.Client // the one client, for a tool that opens the bus store itself
Store hook.Store
// contains filtered or unexported fields
}
Rig is one fake store and the hook.Store over it.
func (*Rig) Evidence ¶
Evidence is what a heartbeat gives a name now: a server row (written only where none is), and the name's answer to its challenge, so the gate's evidence rule (hook.Served.Down) holds for a test that is not about the heartbeat.
func (*Rig) Hook ¶
Hook hooks name in as role, as nova-hook hook does (the identity's word: after an unhook, or over another role), with every push of the role live and proven, as its holders would after their first beat.