Fix Ginkgo entries in Godeps.json. (#29402)
This commit is contained in:
2
vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_linux_arm64.go
generated
vendored
2
vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_linux_arm64.go
generated
vendored
@@ -8,4 +8,4 @@ import "syscall"
|
||||
// use the nearly identical syscall.Dup3 instead
|
||||
func syscallDup(oldfd int, newfd int) (err error) {
|
||||
return syscall.Dup3(oldfd, newfd, 0)
|
||||
}
|
||||
}
|
||||
|
2
vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_solaris.go
generated
vendored
2
vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_solaris.go
generated
vendored
@@ -6,4 +6,4 @@ import "golang.org/x/sys/unix"
|
||||
|
||||
func syscallDup(oldfd int, newfd int) (err error) {
|
||||
return unix.Dup2(oldfd, newfd)
|
||||
}
|
||||
}
|
||||
|
2
vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_unix.go
generated
vendored
2
vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_unix.go
generated
vendored
@@ -8,4 +8,4 @@ import "syscall"
|
||||
|
||||
func syscallDup(oldfd int, newfd int) (err error) {
|
||||
return syscall.Dup2(oldfd, newfd)
|
||||
}
|
||||
}
|
||||
|
3
vendor/github.com/onsi/gomega/.travis.yml
generated
vendored
3
vendor/github.com/onsi/gomega/.travis.yml
generated
vendored
@@ -1,7 +1,8 @@
|
||||
language: go
|
||||
go:
|
||||
- 1.5
|
||||
- tip
|
||||
- 1.6.2
|
||||
- stable
|
||||
|
||||
install:
|
||||
- go get -v ./...
|
||||
|
13
vendor/github.com/onsi/gomega/format/format.go
generated
vendored
13
vendor/github.com/onsi/gomega/format/format.go
generated
vendored
@@ -261,16 +261,3 @@ func isNilValue(a reflect.Value) bool {
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
func isNil(a interface{}) bool {
|
||||
if a == nil {
|
||||
return true
|
||||
}
|
||||
|
||||
switch reflect.TypeOf(a).Kind() {
|
||||
case reflect.Chan, reflect.Func, reflect.Interface, reflect.Map, reflect.Ptr, reflect.Slice:
|
||||
return reflect.ValueOf(a).IsNil()
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
9
vendor/github.com/onsi/gomega/matchers.go
generated
vendored
9
vendor/github.com/onsi/gomega/matchers.go
generated
vendored
@@ -214,6 +214,15 @@ func MatchJSON(json interface{}) types.GomegaMatcher {
|
||||
}
|
||||
}
|
||||
|
||||
//MatchYAML succeeds if actual is a string or stringer of YAML that matches
|
||||
//the expected YAML. The YAML's are decoded and the resulting objects are compared via
|
||||
//reflect.DeepEqual so things like key-ordering and whitespace shouldn't matter.
|
||||
func MatchYAML(yaml interface{}) types.GomegaMatcher {
|
||||
return &matchers.MatchYAMLMatcher{
|
||||
YAMLToMatch: yaml,
|
||||
}
|
||||
}
|
||||
|
||||
//BeEmpty succeeds if actual is empty. Actual must be of type string, array, map, chan, or slice.
|
||||
func BeEmpty() types.GomegaMatcher {
|
||||
return &matchers.BeEmptyMatcher{}
|
||||
|
74
vendor/github.com/onsi/gomega/matchers/match_yaml_matcher.go
generated
vendored
Normal file
74
vendor/github.com/onsi/gomega/matchers/match_yaml_matcher.go
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
package matchers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"strings"
|
||||
|
||||
"github.com/onsi/gomega/format"
|
||||
"gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
type MatchYAMLMatcher struct {
|
||||
YAMLToMatch interface{}
|
||||
}
|
||||
|
||||
func (matcher *MatchYAMLMatcher) Match(actual interface{}) (success bool, err error) {
|
||||
actualString, expectedString, err := matcher.toStrings(actual)
|
||||
if err != nil {
|
||||
return false, err
|
||||
}
|
||||
|
||||
var aval interface{}
|
||||
var eval interface{}
|
||||
|
||||
if err := yaml.Unmarshal([]byte(actualString), &aval); err != nil {
|
||||
return false, fmt.Errorf("Actual '%s' should be valid YAML, but it is not.\nUnderlying error:%s", actualString, err)
|
||||
}
|
||||
if err := yaml.Unmarshal([]byte(expectedString), &eval); err != nil {
|
||||
return false, fmt.Errorf("Expected '%s' should be valid YAML, but it is not.\nUnderlying error:%s", expectedString, err)
|
||||
}
|
||||
|
||||
return reflect.DeepEqual(aval, eval), nil
|
||||
}
|
||||
|
||||
func (matcher *MatchYAMLMatcher) FailureMessage(actual interface{}) (message string) {
|
||||
actualString, expectedString, _ := matcher.toNormalisedStrings(actual)
|
||||
return format.Message(actualString, "to match YAML of", expectedString)
|
||||
}
|
||||
|
||||
func (matcher *MatchYAMLMatcher) NegatedFailureMessage(actual interface{}) (message string) {
|
||||
actualString, expectedString, _ := matcher.toNormalisedStrings(actual)
|
||||
return format.Message(actualString, "not to match YAML of", expectedString)
|
||||
}
|
||||
|
||||
func (matcher *MatchYAMLMatcher) toNormalisedStrings(actual interface{}) (actualFormatted, expectedFormatted string, err error) {
|
||||
actualString, expectedString, err := matcher.toStrings(actual)
|
||||
return normalise(actualString), normalise(expectedString), err
|
||||
}
|
||||
|
||||
func normalise(input string) string {
|
||||
var val interface{}
|
||||
err := yaml.Unmarshal([]byte(input), &val)
|
||||
if err != nil {
|
||||
panic(err) // guarded by Match
|
||||
}
|
||||
output, err := yaml.Marshal(val)
|
||||
if err != nil {
|
||||
panic(err) // guarded by Unmarshal
|
||||
}
|
||||
return strings.TrimSpace(string(output))
|
||||
}
|
||||
|
||||
func (matcher *MatchYAMLMatcher) toStrings(actual interface{}) (actualFormatted, expectedFormatted string, err error) {
|
||||
actualString, ok := toString(actual)
|
||||
if !ok {
|
||||
return "", "", fmt.Errorf("MatchYAMLMatcher matcher requires a string, stringer, or []byte. Got actual:\n%s", format.Object(actual, 1))
|
||||
}
|
||||
expectedString, ok := toString(matcher.YAMLToMatch)
|
||||
if !ok {
|
||||
return "", "", fmt.Errorf("MatchYAMLMatcher matcher requires a string, stringer, or []byte. Got expected:\n%s", format.Object(matcher.YAMLToMatch, 1))
|
||||
}
|
||||
|
||||
return actualString, expectedString, nil
|
||||
}
|
Reference in New Issue
Block a user