8b909fc
]03b0461
]5533ce8
]6fff58f
]69d9b43
]f3de367
, a085d30
]40dd6ad
]29a4b97
]ae19f1b
]4bbecc8
]9be8410
]41673fd
]7ac6b01
]cc102ab
]a4ff0fc
, b7d1a52
]041ae3b
, 6e33911
]bb2c830
, fcebc62
]13057c3
, a9c79f1
]b8043e5
, 4fc1762
]9c1fb20
]Improvements:
Equal
matcher matches byte slices more performantly.MatchError
matches error strings.MatchXML
ignores the order of xml node attributes.Bug Fixes:
gexec.Build
concurrently.Improvements:
BeSent
which attempts to send a value down a channel and fails if the attempt blocks. Can be paired with Eventually
to safely send a value down a channel with a timeout.Ω
, Expect
, Eventually
, and Consistently
now immediately panic
if there is no registered fail handler. This is always a mistake that can hide failing tests.Receive()
no longer errors when passed a closed channel, it's perfectly fine to attempt to read from a closed channel so Ω(c).Should(Receive()) always fails and Ω(c).ShoudlNot(Receive()) always passes with a closed channel.HavePrefix
and HaveSuffix
matchers.ghttp
can now handle concurrent requests.Succeed
which allows one to write Ω(MyFunction()).Should(Succeed())
.ghttp
's behavior around failing assertions and panics:
ghttp
will return 500
.ghttp
will return 500
and fail the test. This is new behavior that may cause existing code to break. This code is almost certainly incorrect and creating a false positive.ghttp
servers can take an io.Writer
. ghttp
will write a line to the writer when each request arrives.WithTransform
matcher to allow munging input data before feeding into the relevant matcherAnd
, Or
, and Not
matchers to allow creating composite matchersgbytes.TimeoutCloser
, gbytes.TimeoutReader
, and gbytes.TimeoutWriter
- these are convenience wrappers that timeout if the underlying Closer/Reader/Writer does not return within the alloted time.gbytes.BufferReader
- this constructs a gbytes.Buffer
that asynchronously reads the passed-in io.Reader
into its buffer.Bug Fixes:
session.Wait
now uses EventuallyWithOffset
to get the right line number in the failure.ContainElement
no longer bails if a passed-in matcher errors.No changes. Dropping "beta" from the version number.
Breaking Changes:
Match
return failure messages, two new methods FailureMessage
and NegatedFailureMessage
are called instead.New Test-Support Features:
ghttp
: supports testing http clients
gbytes
: supports making ordered assertions against streams of data
gbytes.Buffer
Say
matcher to perform ordered assertions against output datagexec
: supports testing external processes
exec.Cmd
commandsExit
matcher to assert against exit code.DSL Changes:
Eventually
and Consistently
can accept time.Duration
interval and polling inputs.Eventually
and Consistently
are now configurable.New Matchers:
ConsistOf
: order-independent assertion against the elements of an array/slice or keys of a map.BeTemporally
: like BeNumerically
but for time.Time
HaveKeyWithValue
: asserts a map has a given key with the given value.Updated Matchers:
Receive
matcher can take a matcher as an argument and passes only if the channel under test receives an objet that satisfies the passed-in matcher.MatchMayChangeInTheFuture(actual interface{}) bool
can inform Eventually
and/or Consistently
when a match has no chance of changing status in the future. For example, Receive
returns false
when a channel is closed.Misc:
Major refactor:
internal