mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-08-02 12:38:47 +00:00
Update pegomock
This commit is contained in:
2
Gopkg.lock
generated
2
Gopkg.lock
generated
@@ -149,7 +149,7 @@
|
||||
branch = "master"
|
||||
name = "github.com/petergtz/pegomock"
|
||||
packages = [".","internal/verify"]
|
||||
revision = "53d177bf13d74db3a7120c60f03d4f42bea4b608"
|
||||
revision = "b99e34d8f73c46cb5e7fef35963a0b0bb89887eb"
|
||||
|
||||
[[projects]]
|
||||
name = "github.com/pkg/errors"
|
||||
|
||||
2
vendor/github.com/petergtz/pegomock/dsl.go
generated
vendored
2
vendor/github.com/petergtz/pegomock/dsl.go
generated
vendored
@@ -173,7 +173,7 @@ func formatParams(params []Param) (result string) {
|
||||
if i > 0 {
|
||||
result += ", "
|
||||
}
|
||||
result += fmt.Sprint(param)
|
||||
result += fmt.Sprintf("%#v", param)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
21
vendor/github.com/petergtz/pegomock/dsl_test.go
generated
vendored
21
vendor/github.com/petergtz/pegomock/dsl_test.go
generated
vendored
@@ -556,8 +556,8 @@ var _ = Describe("MockDisplay", func() {
|
||||
"Mock invocation count for method \"Flash\" with params [wrong string -987] " +
|
||||
"does not match expectation.\n\n\tExpected: 1; but got: 0\n\n" +
|
||||
"\tBut other interactions with this mock were:\n" +
|
||||
"\tFlash(Hello, 123)\n" +
|
||||
"\tFlash(Again, 456)\n",
|
||||
"\tFlash(\"Hello\", 123)\n" +
|
||||
"\tFlash(\"Again\", 456)\n",
|
||||
))
|
||||
})
|
||||
|
||||
@@ -569,11 +569,24 @@ var _ = Describe("MockDisplay", func() {
|
||||
"Mock invocation count for method \"Flash\" with params [wrong string -987] " +
|
||||
"does not match expectation.\n\n\tExpected: 1; but got: 0\n\n" +
|
||||
"\tBut other interactions with this mock were:\n" +
|
||||
"\tFlash(Hello, 123)\n" +
|
||||
"\tShow(Again)\n"),
|
||||
"\tFlash(\"Hello\", 123)\n" +
|
||||
"\tShow(\"Again\")\n"),
|
||||
)
|
||||
})
|
||||
|
||||
It("formats params in interactions with Go syntax for better readability", func() {
|
||||
display.NetHttpRequestParam(http.Request{Host: "x.com"})
|
||||
Expect(func() { display.VerifyWasCalledOnce().NetHttpRequestParam(http.Request{Host: "y.com"}) }).To(PanicWith(
|
||||
`Mock invocation count for method "NetHttpRequestParam" with params [{ <nil> 0 0 map[] <nil> <nil> 0 [] false y.com map[] map[] <nil> map[] <nil> <nil> <nil> <nil>}] does not match expectation.
|
||||
|
||||
Expected: 1; but got: 0
|
||||
|
||||
But other interactions with this mock were:
|
||||
NetHttpRequestParam(http.Request{Method:"", URL:(*url.URL)(nil), Proto:"", ProtoMajor:0, ProtoMinor:0, Header:http.Header(nil), Body:io.ReadCloser(nil), GetBody:(func() (io.ReadCloser, error))(nil), ContentLength:0, TransferEncoding:[]string(nil), Close:false, Host:"x.com", Form:url.Values(nil), PostForm:url.Values(nil), MultipartForm:(*multipart.Form)(nil), Trailer:http.Header(nil), RemoteAddr:"", RequestURI:"", TLS:(*tls.ConnectionState)(nil), Cancel:(<-chan struct {})(nil), Response:(*http.Response)(nil), ctx:context.Context(nil)})
|
||||
`,
|
||||
))
|
||||
})
|
||||
|
||||
It("shows no interactions if there were none", func() {
|
||||
Expect(func() { display.VerifyWasCalledOnce().Flash("wrong string", -987) }).To(PanicWith(
|
||||
"Mock invocation count for method \"Flash\" with params [wrong string -987] " +
|
||||
|
||||
Reference in New Issue
Block a user