1 Star 0 Fork 0

zhuchance / kubernetes

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
succeed_matcher.go 686 Bytes
Copy Edit Raw Blame History
package matchers
import (
"fmt"
"github.com/onsi/gomega/format"
)
type SucceedMatcher struct {
}
func (matcher *SucceedMatcher) Match(actual interface{}) (success bool, err error) {
if actual == nil {
return true, nil
}
if isError(actual) {
return false, nil
}
return false, fmt.Errorf("Expected an error-type. Got:\n%s", format.Object(actual, 1))
}
func (matcher *SucceedMatcher) FailureMessage(actual interface{}) (message string) {
return fmt.Sprintf("Expected success, but got an error:\n%s", format.Object(actual, 1))
}
func (matcher *SucceedMatcher) NegatedFailureMessage(actual interface{}) (message string) {
return "Expected failure, but got no error."
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/meoom/kubernetes.git
git@gitee.com:meoom/kubernetes.git
meoom
kubernetes
kubernetes
v1.0.7

Search

344bd9b3 5694891 D2dac590 5694891