gomega

Ginkgo's Preferred Matcher Library

MIT License

Stars
2.2K
Committers
154
gomega - v1.16.0

Published by blgm about 3 years ago

Features

  • feat: HaveHTTPStatus multiple expected values (#465) [aa69f1b]
  • feat: HaveHTTPHeaderWithValue() matcher (#463) [dd83a96]
  • feat: HaveHTTPBody matcher (#462) [504e1f2]
  • feat: formatter for HTTP responses (#461) [e5b3157]
gomega - v1.15.0

Published by onsi about 3 years ago

1.15.0

Fixes

The previous version (1.14.0) introduced a change to allow Eventually and Consistently to support functions that make assertions. This was accomplished by overriding the global fail handler when running the callbacks passed to Eventually/Consistently in order to capture any resulting errors. Issue #457 uncovered a flaw with this approach: when multiple Eventuallys are running concurrently they race when overriding the singleton global fail handler.

1.15.0 resolves this by requiring users who want to make assertions in Eventually/Consistently call backs to explicitly pass in a function that takes a Gomega as an argument. The passed-in Gomega instance can be used to make assertions. Any failures will cause Eventually to retry the callback. This cleaner interface avoids the issue of swapping out globals but comes at the cost of changing the contract introduced in v1.14.0. As such 1.15.0 introduces a breaking change with respect to 1.14.0 - however we expect that adoption of this feature in 1.14.0 remains limited.

In addition, 1.15.0 cleans up some of Gomega's internals. Most users shouldn't notice any differences stemming from the refactoring that was made.

gomega - v1.14.0

Published by onsi over 3 years ago

1.14.0

Features

  • gmeasure.SamplingConfig now suppers a MinSamplingInterval [e94dbca]
  • Eventually and Consistently support functions that make assertions [2f04e6e]
    • Eventually and Consistently now allow their passed-in functions to make assertions.
      These assertions must pass or the function is considered to have failed and is retried.
    • Eventually and Consistently can now take functions with no return values. These implicitly return nil
      if they contain no failed assertion. Otherwise they return an error wrapping the first assertion failure. This allows
      these functions to be used with the Succeed() matcher.
    • Introduce InterceptGomegaFailure - an analogue to InterceptGomegaFailures - that captures the first assertion failure
      and halts execution in its passed-in callback.

Fixes

  • Call Verify GHTTPWithGomega receiver funcs (#454) [496e6fd]
  • Build a binary with an expected name (#446) [7356360]
gomega - v1.13.0

Published by onsi over 3 years ago

  • Set consistently and eventually defaults on init (#443)

    Using environment variables

    Closes #434

    Signed-off-by: toby lorne [email protected]

  • gmeasure provides BETA support for benchmarking (#447)

    gmeasure is a new gomega subpackage intended to provide measurement and benchmarking support for durations and values. gmeasure replaces Ginkgo V1s deprecated Measure nodes and provides a migration path for users migrating to Ginkgo V2.

    gmeasure is organized around an Experiment metaphor. Experiments can record several different Measurements, with each Measurement comprised of multiple data points. Measurements can hold time.Durations and float64 values and gmeasure includes support measuring the duraiton of callback functions and for sampling functions repeatedly to build an ensemble of data points. In addition, gmeasure introduces a Stopwatch abtraction for easily measuring and recording durations of code segments.

    Once measured, users can readily generate Stats for Measurements to capture their key statistics and these stats can be ranked using a Ranking and associated RankingCriteria.

    Experiments can be Cached to disk to speed up subsequent runs. Experiments are cached by name and version number which makes it easy to manage and bust the cache.

    Finally, gmeasure integrates with Ginkgo V2 via the new ReportEntry abstraction. Experiments, Measurements, and Rankings can all be registered via AddReportEntry. Doing so generates colorful reports as part of Ginkgo's test output.

    gmeasure is currently in beta and will go GA around when Ginkgo V2 goes GA.

gomega - v1.12.0

Published by onsi over 3 years ago

Features

  • Add Satisfy() matcher (#437) [c548f31]
  • tweak truncation message [3360b8c]
  • Add format.GomegaStringer (#427) [cc80b6f]
  • Add Clear() method to gbytes.Buffer [c3c0920]

Fixes

  • Fix error message in BeNumericallyMatcher (#432) [09c074a]
  • Bump github.com/onsi/ginkgo from 1.12.1 to 1.16.2 (#442) [e5f6ea0]
  • Bump github.com/golang/protobuf from 1.4.3 to 1.5.2 (#431) [adae3bf]
  • Bump golang.org/x/net (#441) [3275b35]
gomega - v1.11.0

Published by blgm over 3 years ago

Features

  • feature: add index to gstruct element func (#419) [334e00d]
  • feat(gexec) Add CompileTest functions. Close #410 (#411) [47c613f]

Fixes

  • Check more carefully for nils in WithTransform (#423) [3c60a15]
  • fix: typo in Makefile [b82522a]
  • Allow WithTransform function to accept a nil value (#422) [b75d2f2]
  • fix: print value type for interface{} containers (#409) [f08e2dc]
  • fix(BeElementOf): consistently flatten expected values [1fa9468]
gomega - v1.10.5

Published by blgm over 3 years ago

Fixes

  • fix: collections matchers should display type of expectation (#408) [6b4eb5a]
  • fix(ContainElements): consistently flatten expected values [073b880]
  • fix(ConsistOf): consistently flatten expected values [7266efe]
gomega - v1.10.4

Published by blgm almost 4 years ago

Fixes

  • update golang net library to more recent version without vulnerability (#406) [817a8b9]
  • Correct spelling: alloted -> allotted (#403) [0bae715]
  • fix a panic in MessageWithDiff with long message (#402) [ea06b9b]
gomega - v1.10.3

Published by blgm about 4 years ago

Fixes

  • updates golang/x/net to fix vulnerability detected by snyk (#394) [c479356]
gomega - v1.10.2

Published by blgm about 4 years ago

Fixes

  • Add ExpectWithOffset, EventuallyWithOffset and ConsistentlyWithOffset to WithT (#391) [990941a]
gomega - v1.10.1

Published by blgm over 4 years ago

Fixes

  • Update dependencies (#389) [9f5eecd]
gomega - v1.10.0

Published by williammartin over 4 years ago

Features

  • Add HaveHTTPStatusMatcher (#378) [f335c94]
  • Changed matcher for content-type in VerifyJSONRepresenting (#377) [6024f5b]
  • Make ghttp usable with x-unit style tests (#376) [c0be499]
  • Implement PanicWith matcher (#381) [f8032b4]
gomega - v1.9.0

Published by blgm over 4 years ago

Features

  • Add ContainElements matcher (#370) [2f57380]
  • Output missing and extra elements in ConsistOf failure message [a31eda7]
  • Document method LargestMatching [7c5a280]
gomega - v1.8.1

Published by blgm almost 5 years ago

Fixes

  • Fix unexpected MatchError() behaviour (#375) [8ae7b2f]
gomega - v1.8.0

Published by blgm almost 5 years ago

Features

  • Allow optional description to be lazily evaluated function (#364) [bf64010]
  • Support wrapped errors (#359) [0a981cb]
gomega - v1.7.1

Published by blgm almost 5 years ago

Fixes

  • Bump go-yaml version to cover fixed ddos heuristic (#362) [95e431e]
gomega -

Published by blgm about 5 years ago

Features

  • export format property variables (#347) [642e5ba]

Fixes

  • minor fix in the documentation of ExpectWithOffset (#358) [beea727]
gomega -

Published by blgm about 5 years ago

Features

  • Display special chars on error [41e1b26]
  • Add BeElementOf matcher [6a48b48]

Fixes

  • Remove duplication in XML matcher tests [cc1a6cb]
  • Remove unnecessary conversions (#357) [7bf756a]
  • Fixed import order (#353) [2e3b965]
  • Added missing error handling in test (#355) [c98d3eb]
  • Simplify code (#356) [0001ed9]
  • Simplify code (#354) [0d9100e]
  • Fixed typos (#352) [3f647c4]
  • Add failure message tests to BeElementOf matcher [efe19c3]
  • Update go-testcov untested sections [37ee382]
  • Mark all uncovered files so go-testcov ./... works [53b150e]
  • Reenable gotip in travis [5c249dc]
  • Fix the typo of comment (#345) [f0e010e]
  • Optimize contain_element_matcher [abeb93d]
gomega - v1.5.0

Published by williammartin over 5 years ago

Features

  • Added MatchKeys matchers [8b909fc]

Fixes and Minor Improvements

  • Add type aliases to remove stuttering [03b0461]
  • Don't run session_test.go on windows (#324) [5533ce8]
gomega -

Published by blgm almost 6 years ago

Fixes:

  • ensure file name and line numbers are correctly reported for XUnit [6fff58f]
  • Fixed matcher for content-type (#305) [69d9b43]