mirror of
https://github.com/rancher/plugins.git
synced 2025-09-19 22:40:17 +00:00
Moves to official vendoring solution
This commit is contained in:
30
vendor/github.com/onsi/gomega/matchers/have_occurred_matcher.go
generated
vendored
Normal file
30
vendor/github.com/onsi/gomega/matchers/have_occurred_matcher.go
generated
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
package matchers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/onsi/gomega/format"
|
||||
)
|
||||
|
||||
type HaveOccurredMatcher struct {
|
||||
}
|
||||
|
||||
func (matcher *HaveOccurredMatcher) Match(actual interface{}) (success bool, err error) {
|
||||
if isNil(actual) {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
if isError(actual) {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
return false, fmt.Errorf("Expected an error. Got:\n%s", format.Object(actual, 1))
|
||||
}
|
||||
|
||||
func (matcher *HaveOccurredMatcher) FailureMessage(actual interface{}) (message string) {
|
||||
return fmt.Sprintf("Expected an error to have occurred. Got:\n%s", format.Object(actual, 1))
|
||||
}
|
||||
|
||||
func (matcher *HaveOccurredMatcher) NegatedFailureMessage(actual interface{}) (message string) {
|
||||
return fmt.Sprintf("Expected error:\n%s\n%s\n%s", format.Object(actual, 1), format.IndentString(actual.(error).Error(), 1), "not to have occurred")
|
||||
}
|
Reference in New Issue
Block a user