diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-01-15 01:37:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-15 01:37:19 +0100 |
commit | 12aa9caf97bdcb6dc71a8c94c4875f9e0e87022a (patch) | |
tree | f0dc54d0ff39dc1f5ad56ecf8619f47ea7f22771 /vendor/github.com/onsi/gomega/internal/asyncassertion/async_assertion.go | |
parent | 0aa9dba3e1009dbbdf59d47d9370db0de4679730 (diff) | |
parent | f5bda9994d5e6cb1ee42ade5e7786059feedf633 (diff) | |
download | podman-12aa9caf97bdcb6dc71a8c94c4875f9e0e87022a.tar.gz podman-12aa9caf97bdcb6dc71a8c94c4875f9e0e87022a.tar.bz2 podman-12aa9caf97bdcb6dc71a8c94c4875f9e0e87022a.zip |
Merge pull request #4866 from TomSweeneyRedHat/dev/tsweeney/buildah1.13.1
Bump to Buildah v1.13.1
Diffstat (limited to 'vendor/github.com/onsi/gomega/internal/asyncassertion/async_assertion.go')
-rw-r--r-- | vendor/github.com/onsi/gomega/internal/asyncassertion/async_assertion.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/vendor/github.com/onsi/gomega/internal/asyncassertion/async_assertion.go b/vendor/github.com/onsi/gomega/internal/asyncassertion/async_assertion.go index a233e48c0..5204836bf 100644 --- a/vendor/github.com/onsi/gomega/internal/asyncassertion/async_assertion.go +++ b/vendor/github.com/onsi/gomega/internal/asyncassertion/async_assertion.go @@ -60,9 +60,12 @@ func (assertion *AsyncAssertion) buildDescription(optionalDescription ...interfa switch len(optionalDescription) { case 0: return "" - default: - return fmt.Sprintf(optionalDescription[0].(string), optionalDescription[1:]...) + "\n" + case 1: + if describe, ok := optionalDescription[0].(func() string); ok { + return describe() + "\n" + } } + return fmt.Sprintf(optionalDescription[0].(string), optionalDescription[1:]...) + "\n" } func (assertion *AsyncAssertion) actualInputIsAFunction() bool { @@ -103,8 +106,6 @@ func (assertion *AsyncAssertion) match(matcher types.GomegaMatcher, desiredMatch timer := time.Now() timeout := time.After(assertion.timeoutInterval) - description := assertion.buildDescription(optionalDescription...) - var matches bool var err error mayChange := true @@ -129,6 +130,7 @@ func (assertion *AsyncAssertion) match(matcher types.GomegaMatcher, desiredMatch } } assertion.failWrapper.TWithHelper.Helper() + description := assertion.buildDescription(optionalDescription...) assertion.failWrapper.Fail(fmt.Sprintf("%s after %.3fs.\n%s%s%s", preamble, time.Since(timer).Seconds(), description, message, errMsg), 3+assertion.offset) } |