Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
c67d403d
Commit
c67d403d
authored
Aug 02, 2016
by
Ryan Hitchman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Ginkgo entries in Godeps.json. (#29402)
parent
8805bbba
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
156 additions
and
88 deletions
+156
-88
Godeps.json
Godeps/Godeps.json
+68
-68
syscall_dup_linux_arm64.go
...om/onsi/ginkgo/internal/remote/syscall_dup_linux_arm64.go
+1
-2
syscall_dup_solaris.go
...ub.com/onsi/ginkgo/internal/remote/syscall_dup_solaris.go
+1
-2
syscall_dup_unix.go
...ithub.com/onsi/ginkgo/internal/remote/syscall_dup_unix.go
+1
-2
.travis.yml
vendor/github.com/onsi/gomega/.travis.yml
+2
-1
format.go
vendor/github.com/onsi/gomega/format/format.go
+0
-13
matchers.go
vendor/github.com/onsi/gomega/matchers.go
+9
-0
match_yaml_matcher.go
vendor/github.com/onsi/gomega/matchers/match_yaml_matcher.go
+74
-0
No files found.
Godeps/Godeps.json
View file @
c67d403d
...
@@ -1473,173 +1473,173 @@
...
@@ -1473,173 +1473,173 @@
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo"
,
"ImportPath"
:
"github.com/onsi/ginkgo"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/config"
,
"ImportPath"
:
"github.com/onsi/ginkgo/config"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/ginkgo"
,
"ImportPath"
:
"github.com/onsi/ginkgo/ginkgo"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/ginkgo/convert"
,
"ImportPath"
:
"github.com/onsi/ginkgo/ginkgo/convert"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/ginkgo/interrupthandler"
,
"ImportPath"
:
"github.com/onsi/ginkgo/ginkgo/interrupthandler"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/ginkgo/nodot"
,
"ImportPath"
:
"github.com/onsi/ginkgo/ginkgo/nodot"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/ginkgo/testrunner"
,
"ImportPath"
:
"github.com/onsi/ginkgo/ginkgo/testrunner"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/ginkgo/testsuite"
,
"ImportPath"
:
"github.com/onsi/ginkgo/ginkgo/testsuite"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/ginkgo/watch"
,
"ImportPath"
:
"github.com/onsi/ginkgo/ginkgo/watch"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/internal/codelocation"
,
"ImportPath"
:
"github.com/onsi/ginkgo/internal/codelocation"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/internal/containernode"
,
"ImportPath"
:
"github.com/onsi/ginkgo/internal/containernode"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/internal/failer"
,
"ImportPath"
:
"github.com/onsi/ginkgo/internal/failer"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/internal/leafnodes"
,
"ImportPath"
:
"github.com/onsi/ginkgo/internal/leafnodes"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/internal/remote"
,
"ImportPath"
:
"github.com/onsi/ginkgo/internal/remote"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/internal/spec"
,
"ImportPath"
:
"github.com/onsi/ginkgo/internal/spec"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/internal/specrunner"
,
"ImportPath"
:
"github.com/onsi/ginkgo/internal/specrunner"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/internal/suite"
,
"ImportPath"
:
"github.com/onsi/ginkgo/internal/suite"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/internal/testingtproxy"
,
"ImportPath"
:
"github.com/onsi/ginkgo/internal/testingtproxy"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/internal/writer"
,
"ImportPath"
:
"github.com/onsi/ginkgo/internal/writer"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/reporters"
,
"ImportPath"
:
"github.com/onsi/ginkgo/reporters"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/reporters/stenographer"
,
"ImportPath"
:
"github.com/onsi/ginkgo/reporters/stenographer"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/ginkgo/types"
,
"ImportPath"
:
"github.com/onsi/ginkgo/types"
,
"Comment"
:
"v1.2.0-6
0-g7d32401
"
,
"Comment"
:
"v1.2.0-6
6-g74c678d
"
,
"Rev"
:
"7
d3240191d7b2311b60090fcbc96e56bffc45ec0
"
"Rev"
:
"7
4c678d97c305753605c338c6c78c49ec104b5e7
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/gomega"
,
"ImportPath"
:
"github.com/onsi/gomega"
,
"Comment"
:
"v1.0-
91-g7ce781e
"
,
"Comment"
:
"v1.0-
115-g9ed8da1
"
,
"Rev"
:
"
7ce781ea776b2fd506491011353bded2e40c8467
"
"Rev"
:
"
9ed8da19f2156b87a803a8fdf6d126f627a12db1
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/gomega/format"
,
"ImportPath"
:
"github.com/onsi/gomega/format"
,
"Comment"
:
"v1.0-
91-g7ce781e
"
,
"Comment"
:
"v1.0-
115-g9ed8da1
"
,
"Rev"
:
"
7ce781ea776b2fd506491011353bded2e40c8467
"
"Rev"
:
"
9ed8da19f2156b87a803a8fdf6d126f627a12db1
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/gomega/internal/assertion"
,
"ImportPath"
:
"github.com/onsi/gomega/internal/assertion"
,
"Comment"
:
"v1.0-
91-g7ce781e
"
,
"Comment"
:
"v1.0-
115-g9ed8da1
"
,
"Rev"
:
"
7ce781ea776b2fd506491011353bded2e40c8467
"
"Rev"
:
"
9ed8da19f2156b87a803a8fdf6d126f627a12db1
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/gomega/internal/asyncassertion"
,
"ImportPath"
:
"github.com/onsi/gomega/internal/asyncassertion"
,
"Comment"
:
"v1.0-
91-g7ce781e
"
,
"Comment"
:
"v1.0-
115-g9ed8da1
"
,
"Rev"
:
"
7ce781ea776b2fd506491011353bded2e40c8467
"
"Rev"
:
"
9ed8da19f2156b87a803a8fdf6d126f627a12db1
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/gomega/internal/oraclematcher"
,
"ImportPath"
:
"github.com/onsi/gomega/internal/oraclematcher"
,
"Comment"
:
"v1.0-
91-g7ce781e
"
,
"Comment"
:
"v1.0-
115-g9ed8da1
"
,
"Rev"
:
"
7ce781ea776b2fd506491011353bded2e40c8467
"
"Rev"
:
"
9ed8da19f2156b87a803a8fdf6d126f627a12db1
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/gomega/internal/testingtsupport"
,
"ImportPath"
:
"github.com/onsi/gomega/internal/testingtsupport"
,
"Comment"
:
"v1.0-
91-g7ce781e
"
,
"Comment"
:
"v1.0-
115-g9ed8da1
"
,
"Rev"
:
"
7ce781ea776b2fd506491011353bded2e40c8467
"
"Rev"
:
"
9ed8da19f2156b87a803a8fdf6d126f627a12db1
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/gomega/matchers"
,
"ImportPath"
:
"github.com/onsi/gomega/matchers"
,
"Comment"
:
"v1.0-
91-g7ce781e
"
,
"Comment"
:
"v1.0-
115-g9ed8da1
"
,
"Rev"
:
"
7ce781ea776b2fd506491011353bded2e40c8467
"
"Rev"
:
"
9ed8da19f2156b87a803a8fdf6d126f627a12db1
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/gomega/matchers/support/goraph/bipartitegraph"
,
"ImportPath"
:
"github.com/onsi/gomega/matchers/support/goraph/bipartitegraph"
,
"Comment"
:
"v1.0-
91-g7ce781e
"
,
"Comment"
:
"v1.0-
115-g9ed8da1
"
,
"Rev"
:
"
7ce781ea776b2fd506491011353bded2e40c8467
"
"Rev"
:
"
9ed8da19f2156b87a803a8fdf6d126f627a12db1
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/gomega/matchers/support/goraph/edge"
,
"ImportPath"
:
"github.com/onsi/gomega/matchers/support/goraph/edge"
,
"Comment"
:
"v1.0-
91-g7ce781e
"
,
"Comment"
:
"v1.0-
115-g9ed8da1
"
,
"Rev"
:
"
7ce781ea776b2fd506491011353bded2e40c8467
"
"Rev"
:
"
9ed8da19f2156b87a803a8fdf6d126f627a12db1
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/gomega/matchers/support/goraph/node"
,
"ImportPath"
:
"github.com/onsi/gomega/matchers/support/goraph/node"
,
"Comment"
:
"v1.0-
91-g7ce781e
"
,
"Comment"
:
"v1.0-
115-g9ed8da1
"
,
"Rev"
:
"
7ce781ea776b2fd506491011353bded2e40c8467
"
"Rev"
:
"
9ed8da19f2156b87a803a8fdf6d126f627a12db1
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/gomega/matchers/support/goraph/util"
,
"ImportPath"
:
"github.com/onsi/gomega/matchers/support/goraph/util"
,
"Comment"
:
"v1.0-
91-g7ce781e
"
,
"Comment"
:
"v1.0-
115-g9ed8da1
"
,
"Rev"
:
"
7ce781ea776b2fd506491011353bded2e40c8467
"
"Rev"
:
"
9ed8da19f2156b87a803a8fdf6d126f627a12db1
"
},
},
{
{
"ImportPath"
:
"github.com/onsi/gomega/types"
,
"ImportPath"
:
"github.com/onsi/gomega/types"
,
"Comment"
:
"v1.0-
91-g7ce781e
"
,
"Comment"
:
"v1.0-
115-g9ed8da1
"
,
"Rev"
:
"
7ce781ea776b2fd506491011353bded2e40c8467
"
"Rev"
:
"
9ed8da19f2156b87a803a8fdf6d126f627a12db1
"
},
},
{
{
"ImportPath"
:
"github.com/opencontainers/runc/libcontainer"
,
"ImportPath"
:
"github.com/opencontainers/runc/libcontainer"
,
...
...
vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_linux_arm64.go
View file @
c67d403d
...
@@ -8,4 +8,4 @@ import "syscall"
...
@@ -8,4 +8,4 @@ import "syscall"
// use the nearly identical syscall.Dup3 instead
// use the nearly identical syscall.Dup3 instead
func
syscallDup
(
oldfd
int
,
newfd
int
)
(
err
error
)
{
func
syscallDup
(
oldfd
int
,
newfd
int
)
(
err
error
)
{
return
syscall
.
Dup3
(
oldfd
,
newfd
,
0
)
return
syscall
.
Dup3
(
oldfd
,
newfd
,
0
)
}
}
\ No newline at end of file
vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_solaris.go
View file @
c67d403d
...
@@ -6,4 +6,4 @@ import "golang.org/x/sys/unix"
...
@@ -6,4 +6,4 @@ import "golang.org/x/sys/unix"
func
syscallDup
(
oldfd
int
,
newfd
int
)
(
err
error
)
{
func
syscallDup
(
oldfd
int
,
newfd
int
)
(
err
error
)
{
return
unix
.
Dup2
(
oldfd
,
newfd
)
return
unix
.
Dup2
(
oldfd
,
newfd
)
}
}
\ No newline at end of file
vendor/github.com/onsi/ginkgo/internal/remote/syscall_dup_unix.go
View file @
c67d403d
...
@@ -8,4 +8,4 @@ import "syscall"
...
@@ -8,4 +8,4 @@ import "syscall"
func
syscallDup
(
oldfd
int
,
newfd
int
)
(
err
error
)
{
func
syscallDup
(
oldfd
int
,
newfd
int
)
(
err
error
)
{
return
syscall
.
Dup2
(
oldfd
,
newfd
)
return
syscall
.
Dup2
(
oldfd
,
newfd
)
}
}
\ No newline at end of file
vendor/github.com/onsi/gomega/.travis.yml
View file @
c67d403d
language
:
go
language
:
go
go
:
go
:
-
1.5
-
1.5
-
tip
-
1.6.2
-
stable
install
:
install
:
-
go get -v ./...
-
go get -v ./...
...
...
vendor/github.com/onsi/gomega/format/format.go
View file @
c67d403d
...
@@ -261,16 +261,3 @@ func isNilValue(a reflect.Value) bool {
...
@@ -261,16 +261,3 @@ func isNilValue(a reflect.Value) bool {
return
false
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
}
vendor/github.com/onsi/gomega/matchers.go
View file @
c67d403d
...
@@ -214,6 +214,15 @@ func MatchJSON(json interface{}) types.GomegaMatcher {
...
@@ -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.
//BeEmpty succeeds if actual is empty. Actual must be of type string, array, map, chan, or slice.
func
BeEmpty
()
types
.
GomegaMatcher
{
func
BeEmpty
()
types
.
GomegaMatcher
{
return
&
matchers
.
BeEmptyMatcher
{}
return
&
matchers
.
BeEmptyMatcher
{}
...
...
vendor/github.com/onsi/gomega/matchers/match_yaml_matcher.go
0 → 100644
View file @
c67d403d
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.
\n
Underlying 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.
\n
Underlying 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
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment