MCPcopy Create free account
hub / github.com/gavv/httpexpect / IsTrue

Method IsTrue

boolean.go:112–132  ·  view source on GitHub ↗

IsTrue succeeds if boolean is true. Example: boolean := NewBoolean(t, true) boolean.IsTrue()

()

Source from the content-addressed store, hash-verified

110// boolean := NewBoolean(t, true)
111// boolean.IsTrue()
112func (b *Boolean) IsTrue() *Boolean {
113 opChain := b.chain.enter("IsTrue()")
114 defer opChain.leave()
115
116 if opChain.failed() {
117 return b
118 }
119
120 if !(b.value == true) {
121 opChain.fail(AssertionFailure{
122 Type: AssertEqual,
123 Actual: &AssertionValue{b.value},
124 Expected: &AssertionValue{true},
125 Errors: []error{
126 errors.New("expected: boolean is true"),
127 },
128 })
129 }
130
131 return b
132}
133
134// IsFalse succeeds if boolean is false.
135//

Callers 3

TrueMethod · 0.95
TestBoolean_FailedChainFunction · 0.80
TestBoolean_IsValueFunction · 0.80

Calls 4

enterMethod · 0.80
leaveMethod · 0.80
failedMethod · 0.80
failMethod · 0.80

Tested by 2

TestBoolean_FailedChainFunction · 0.64
TestBoolean_IsValueFunction · 0.64