gomega v1.0.0-beta Release Notes
-
๐ฅ Breaking Changes:
- ๐ Changed OmegaMatcher interface. Instead of having
Match
return failure messages, two new methodsFailureMessage
andNegatedFailureMessage
are called instead. - ๐ Moved and renamed OmegaFailHandler to types.GomegaFailHandler and OmegaMatcher to types.GomegaMatcher. Any references to OmegaMatcher in any custom matchers will need to be changed to point to types.GomegaMatcher
๐ New Test-Support Features:
- โ
ghttp
: supports testing http clients- Provides a flexible fake http server
- Provides a collection of chainable http handlers that perform assertions.
- ๐
gbytes
: supports making ordered assertions against streams of data- Provides a
gbytes.Buffer
- Provides a
Say
matcher to perform ordered assertions against output data
- Provides a
- โ
gexec
: supports testing external processes- Provides support for building Go binaries
- Wraps and starts
exec.Cmd
commands - Makes it easy to assert against stdout and stderr
- Makes it easy to send signals and wait for processes to exit
- Provides an
Exit
matcher to assert against exit code.
DSL Changes:
Eventually
andConsistently
can accepttime.Duration
interval and polling inputs.- ๐ง The default timeouts for
Eventually
andConsistently
are now configurable.
๐ New Matchers:
ConsistOf
: order-independent assertion against the elements of an array/slice or keys of a map.BeTemporally
: likeBeNumerically
but fortime.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. - Matchers that implement
MatchMayChangeInTheFuture(actual interface{}) bool
can informEventually
and/orConsistently
when a match has no chance of changing status in the future. For example,Receive
returnsfalse
when a channel is closed.
Misc:
- Start using semantic versioning
- Start maintaining changelog
๐จ Major refactor:
- Pull out Gomega's internal to
internal
- ๐ Changed OmegaMatcher interface. Instead of having