"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "vendor/github.com/onsi/gomega/gomega_dsl.go" between
buildah-1.11.2.tar.gz and buildah-1.11.3.tar.gz

About: Buildah is a tool that facilitates building Open Container Initiative (OCI) container images.

gomega_dsl.go  (buildah-1.11.2):gomega_dsl.go  (buildah-1.11.3)
skipping to change at line 27 skipping to change at line 27
"fmt" "fmt"
"reflect" "reflect"
"time" "time"
"github.com/onsi/gomega/internal/assertion" "github.com/onsi/gomega/internal/assertion"
"github.com/onsi/gomega/internal/asyncassertion" "github.com/onsi/gomega/internal/asyncassertion"
"github.com/onsi/gomega/internal/testingtsupport" "github.com/onsi/gomega/internal/testingtsupport"
"github.com/onsi/gomega/types" "github.com/onsi/gomega/types"
) )
const GOMEGA_VERSION = "1.5.0" const GOMEGA_VERSION = "1.7.0"
const nilFailHandlerPanic = `You are trying to make an assertion, but Gomega's f ail handler is nil. const nilFailHandlerPanic = `You are trying to make an assertion, but Gomega's f ail handler is nil.
If you're using Ginkgo then you probably forgot to put your assertion in an It() . If you're using Ginkgo then you probably forgot to put your assertion in an It() .
Alternatively, you may have forgotten to register a fail handler with RegisterFa ilHandler() or RegisterTestingT(). Alternatively, you may have forgotten to register a fail handler with RegisterFa ilHandler() or RegisterTestingT().
Depending on your vendoring solution you may be inadvertently importing gomega a nd subpackages (e.g. ghhtp, gexec,...) from different locations. Depending on your vendoring solution you may be inadvertently importing gomega a nd subpackages (e.g. ghhtp, gexec,...) from different locations.
` `
var globalFailWrapper *types.GomegaFailWrapper var globalFailWrapper *types.GomegaFailWrapper
var defaultEventuallyTimeout = time.Second var defaultEventuallyTimeout = time.Second
skipping to change at line 158 skipping to change at line 158
// //
// Expect and Ω are identical // Expect and Ω are identical
func Expect(actual interface{}, extra ...interface{}) Assertion { func Expect(actual interface{}, extra ...interface{}) Assertion {
return ExpectWithOffset(0, actual, extra...) return ExpectWithOffset(0, actual, extra...)
} }
// ExpectWithOffset wraps an actual value allowing assertions to be made on it: // ExpectWithOffset wraps an actual value allowing assertions to be made on it:
// ExpectWithOffset(1, "foo").To(Equal("foo")) // ExpectWithOffset(1, "foo").To(Equal("foo"))
// //
// Unlike `Expect` and `Ω`, `ExpectWithOffset` takes an additional integer argum ent // Unlike `Expect` and `Ω`, `ExpectWithOffset` takes an additional integer argum ent
// this is used to modify the call-stack offset when computing line numbers. // that is used to modify the call-stack offset when computing line numbers.
// //
// This is most useful in helper functions that make assertions. If you want Go mega's // This is most useful in helper functions that make assertions. If you want Go mega's
// error message to refer to the calling line in the test (as opposed to the lin e in the helper function) // error message to refer to the calling line in the test (as opposed to the lin e in the helper function)
// set the first argument of `ExpectWithOffset` appropriately. // set the first argument of `ExpectWithOffset` appropriately.
func ExpectWithOffset(offset int, actual interface{}, extra ...interface{}) Asse rtion { func ExpectWithOffset(offset int, actual interface{}, extra ...interface{}) Asse rtion {
if globalFailWrapper == nil { if globalFailWrapper == nil {
panic(nilFailHandlerPanic) panic(nilFailHandlerPanic)
} }
return assertion.New(actual, globalFailWrapper, offset, extra...) return assertion.New(actual, globalFailWrapper, offset, extra...)
} }
skipping to change at line 245 skipping to change at line 245
// Both intervals can either be specified as time.Duration, parsable duration st rings or as floats/integers. In the // Both intervals can either be specified as time.Duration, parsable duration st rings or as floats/integers. In the
// last case they are interpreted as seconds. // last case they are interpreted as seconds.
// //
// If Consistently is passed an actual that is a function taking no arguments an d returning at least one value, // If Consistently is passed an actual that is a function taking no arguments an d returning at least one value,
// then Consistently will call the function periodically and try the matcher aga inst the function's first return value. // then Consistently will call the function periodically and try the matcher aga inst the function's first return value.
// //
// If the function returns more than one value, then Consistently will pass the first value to the matcher and // If the function returns more than one value, then Consistently will pass the first value to the matcher and
// assert that all other values are nil/zero. // assert that all other values are nil/zero.
// This allows you to pass Consistently a function that returns a value and an e rror - a common pattern in Go. // This allows you to pass Consistently a function that returns a value and an e rror - a common pattern in Go.
// //
// Consistently is useful in cases where you want to assert that something *does not happen* over a period of tiem. // Consistently is useful in cases where you want to assert that something *does not happen* over a period of time.
// For example, you want to assert that a goroutine does *not* send data down a channel. In this case, you could: // For example, you want to assert that a goroutine does *not* send data down a channel. In this case, you could:
// //
// Consistently(channel).ShouldNot(Receive()) // Consistently(channel).ShouldNot(Receive())
// //
// Consistently's default duration is 100ms, and its default polling interval is 10ms // Consistently's default duration is 100ms, and its default polling interval is 10ms
func Consistently(actual interface{}, intervals ...interface{}) AsyncAssertion { func Consistently(actual interface{}, intervals ...interface{}) AsyncAssertion {
return ConsistentlyWithOffset(0, actual, intervals...) return ConsistentlyWithOffset(0, actual, intervals...)
} }
// ConsistentlyWithOffset operates like Consistnetly but takes an additional // ConsistentlyWithOffset operates like Consistnetly but takes an additional
skipping to change at line 283 skipping to change at line 283
// SetDefaultEventuallyTimeout sets the default timeout duration for Eventually. Eventually will repeatedly poll your condition until it succeeds, or until this timeout elapses. // SetDefaultEventuallyTimeout sets the default timeout duration for Eventually. Eventually will repeatedly poll your condition until it succeeds, or until this timeout elapses.
func SetDefaultEventuallyTimeout(t time.Duration) { func SetDefaultEventuallyTimeout(t time.Duration) {
defaultEventuallyTimeout = t defaultEventuallyTimeout = t
} }
// SetDefaultEventuallyPollingInterval sets the default polling interval for Eve ntually. // SetDefaultEventuallyPollingInterval sets the default polling interval for Eve ntually.
func SetDefaultEventuallyPollingInterval(t time.Duration) { func SetDefaultEventuallyPollingInterval(t time.Duration) {
defaultEventuallyPollingInterval = t defaultEventuallyPollingInterval = t
} }
// SetDefaultConsistentlyDuration sets the default duration for Consistently. C onsistently will verify that your condition is satsified for this long. // SetDefaultConsistentlyDuration sets the default duration for Consistently. C onsistently will verify that your condition is satisfied for this long.
func SetDefaultConsistentlyDuration(t time.Duration) { func SetDefaultConsistentlyDuration(t time.Duration) {
defaultConsistentlyDuration = t defaultConsistentlyDuration = t
} }
// SetDefaultConsistentlyPollingInterval sets the default polling interval for C onsistently. // SetDefaultConsistentlyPollingInterval sets the default polling interval for C onsistently.
func SetDefaultConsistentlyPollingInterval(t time.Duration) { func SetDefaultConsistentlyPollingInterval(t time.Duration) {
defaultConsistentlyPollingInterval = t defaultConsistentlyPollingInterval = t
} }
// AsyncAssertion is returned by Eventually and Consistently and polls the actua l value passed into Eventually against // AsyncAssertion is returned by Eventually and Consistently and polls the actua l value passed into Eventually against
skipping to change at line 323 skipping to change at line 323
// Assertion is returned by Ω and Expect and compares the actual value to the ma tcher // Assertion is returned by Ω and Expect and compares the actual value to the ma tcher
// passed to the Should/ShouldNot and To/ToNot/NotTo methods. // passed to the Should/ShouldNot and To/ToNot/NotTo methods.
// //
// Typically Should/ShouldNot are used with Ω and To/ToNot/NotTo are used with E xpect // Typically Should/ShouldNot are used with Ω and To/ToNot/NotTo are used with E xpect
// though this is not enforced. // though this is not enforced.
// //
// All methods take a variadic optionalDescription argument. This is passed on to fmt.Sprintf() // All methods take a variadic optionalDescription argument. This is passed on to fmt.Sprintf()
// and is used to annotate failure messages. // and is used to annotate failure messages.
// //
// All methods return a bool that is true if hte assertion passed and false if i t failed. // All methods return a bool that is true if the assertion passed and false if i t failed.
// //
// Example: // Example:
// //
// Ω(farm.HasCow()).Should(BeTrue(), "Farm %v should have a cow", farm) // Ω(farm.HasCow()).Should(BeTrue(), "Farm %v should have a cow", farm)
type Assertion interface { type Assertion interface {
Should(matcher types.GomegaMatcher, optionalDescription ...interface{}) b ool Should(matcher types.GomegaMatcher, optionalDescription ...interface{}) b ool
ShouldNot(matcher types.GomegaMatcher, optionalDescription ...interface{} ) bool ShouldNot(matcher types.GomegaMatcher, optionalDescription ...interface{} ) bool
To(matcher types.GomegaMatcher, optionalDescription ...interface{}) bool To(matcher types.GomegaMatcher, optionalDescription ...interface{}) bool
ToNot(matcher types.GomegaMatcher, optionalDescription ...interface{}) bo ol ToNot(matcher types.GomegaMatcher, optionalDescription ...interface{}) bo ol
 End of changes. 5 change blocks. 
5 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)