mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 09:41:57 +00:00
Upgraded from 99c19923, branch release-3.0. This required fetching or upgrading the following: * k8s.io/api to kubernetes-1.9.1 * k8s.io/apimachinery to kubernetes-1.9.1 * github.com/juju/ratelimit to 1.0.1 * github.com/spf13/pflag to 4c012f6d Also, update Scope's imports/function calls to be compatible with the new client.
27 lines
602 B
Go
27 lines
602 B
Go
package matchers
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/onsi/gomega/format"
|
|
)
|
|
|
|
type BeTrueMatcher struct {
|
|
}
|
|
|
|
func (matcher *BeTrueMatcher) Match(actual interface{}) (success bool, err error) {
|
|
if !isBool(actual) {
|
|
return false, fmt.Errorf("Expected a boolean. Got:\n%s", format.Object(actual, 1))
|
|
}
|
|
|
|
return actual.(bool), nil
|
|
}
|
|
|
|
func (matcher *BeTrueMatcher) FailureMessage(actual interface{}) (message string) {
|
|
return format.Message(actual, "to be true")
|
|
}
|
|
|
|
func (matcher *BeTrueMatcher) NegatedFailureMessage(actual interface{}) (message string) {
|
|
return format.Message(actual, "not to be true")
|
|
}
|