Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Contains check.Checker = &containsChecker{ &check.CheckerInfo{Name: "Contains", Params: []string{"container", "elem"}}, }
Contains is a Checker that looks for a elem in a container. The elem can be any object. The container can be an array, slice or string.
var DeepContains check.Checker = &deepContainsChecker{ &check.CheckerInfo{Name: "DeepContains", Params: []string{"container", "elem"}}, }
DeepContains is a Checker that looks for a elem in a container using DeepEqual. The elem can be any object. The container can be an array, slice or string.
Functions ¶
This section is empty.
Types ¶
type BaseTest ¶
type BaseTest struct {
// contains filtered or unexported fields
}
BaseTest is a structure used as a base test suite for all the snappy tests.
func (*BaseTest) AddCleanup ¶
func (s *BaseTest) AddCleanup(f func())
AddCleanup adds a new cleanup function to the test
func (*BaseTest) SetUpTest ¶
func (s *BaseTest) SetUpTest(c *check.C)
SetUpTest prepares the cleanup
func (*BaseTest) TearDownTest ¶
func (s *BaseTest) TearDownTest(c *check.C)
TearDownTest cleans up the channel.ini files in case they were changed by the test. It also runs the cleanup handlers
type MockCmd ¶
type MockCmd struct {
// contains filtered or unexported fields
}
MockCmd allows mocking commands for testing.
func MockCommand ¶
MockCommand adds a mocked command to PATH.
The command logs all invocations to a dedicated log file. If script is non-empty then it is used as is and the caller is responsible for how the script behaves (exit code and any extra behavior). If script is empty then the command exits successfully without any other side-effect.
func (*MockCmd) Also ¶
Also mock this command, using the same bindir and log Useful when you want to check the ordering of things.
func (*MockCmd) Calls ¶
Calls returns a list of calls that were made to the mock command. of the form:
[][]string{ {"cmd", "arg1", "arg2"}, // first invocation of "cmd" {"cmd", "arg1", "arg2"}, // second invocation of "cmd" }
func (*MockCmd) ForgetCalls ¶
func (cmd *MockCmd) ForgetCalls()
ForgetCalls purges the list of calls made so far