ipld-eth-server/vendor/github.com/onsi/gomega/gstruct/ignore.go
Matt K 293dd2e848 Add vendor dir (#16) (#4)
* Add vendor dir so builds dont require dep

* Pin specific version go-eth version
2018-01-29 13:44:18 -06:00

38 lines
960 B
Go

package gstruct
import (
"github.com/onsi/gomega/types"
)
//Ignore ignores the actual value and always succeeds.
// Expect(nil).To(Ignore())
// Expect(true).To(Ignore())
func Ignore() types.GomegaMatcher {
return &IgnoreMatcher{true}
}
//Reject ignores the actual value and always fails. It can be used in conjunction with IgnoreMissing
//to catch problematic elements, or to verify tests are running.
// Expect(nil).NotTo(Reject())
// Expect(true).NotTo(Reject())
func Reject() types.GomegaMatcher {
return &IgnoreMatcher{false}
}
// A matcher that either always succeeds or always fails.
type IgnoreMatcher struct {
Succeed bool
}
func (m *IgnoreMatcher) Match(actual interface{}) (bool, error) {
return m.Succeed, nil
}
func (m *IgnoreMatcher) FailureMessage(_ interface{}) (message string) {
return "Unconditional failure"
}
func (m *IgnoreMatcher) NegatedFailureMessage(_ interface{}) (message string) {
return "Unconditional success"
}