MCPcopy
hub / github.com/stretchr/testify / Bool

Method Bool

mock/mock.go:1135–1142  ·  view source on GitHub ↗

Bool gets the argument at the specified index. Panics if there is no argument, or if the argument is of the wrong type.

(index int)

Source from the content-addressed store, hash-verified

1133// Bool gets the argument at the specified index. Panics if there is no argument, or
1134// if the argument is of the wrong type.
1135func (args Arguments) Bool(index int) bool {
1136 var s bool
1137 var ok bool
1138 if s, ok = args.Get(index).(bool); !ok {
1139 panic(fmt.Sprintf("assert: arguments: Bool(%d) failed because object wasn't correct type: %v", index, args.Get(index)))
1140 }
1141 return s
1142}
1143
1144func typeAndKind(v interface{}) (reflect.Type, reflect.Kind) {
1145 t := reflect.TypeOf(v)

Callers 3

main.goFile · 0.80
MatchesMethod · 0.80
Test_Arguments_BoolFunction · 0.80

Calls 1

GetMethod · 0.95

Tested by 1

Test_Arguments_BoolFunction · 0.64