Skip to content

Releases: waterlink/spec2.cr

0.8.2: Be or not to be

24 Jun 05:12
Compare
Choose a tag to compare
  • Fixes for crystal 0.18.*

0.8.1: This Release is Type Safe

17 Apr 20:16
Compare
Choose a tag to compare
  • Add type annotations, where new compiler would require them
  • Fix minor type anomalies, that have popped up as instance/class vars got annotated

0.8.0: After the Big Rewrite

31 Mar 01:06
Compare
Choose a tag to compare
  • Makes after { ... } and delayed { ... } hooks to run even in case of assertion failure.

v0.7.1: The Big Rewrite

21 Feb 01:24
Compare
Choose a tag to compare

This patch release makes elapsed time functionality available for usage in custom reporters as ::Spec2::ElapsedTime. Additionally, it fixes the problem with elapsed time, when test suite takes more than one hour.

v0.7.0: Estimates

21 Feb 01:19
Compare
Choose a tag to compare

This minor release adds elapsed time output for standard reporters.

v0.6.0: Delayed Release

21 Feb 01:17
Compare
Choose a tag to compare

This minor release adds new DSL component delayed { ... }. It is used inside of it ".." { ... } block and its block will be executed after test example execution and after all after { ... } hooks execution. Hence the name: Delayed.

v0.5.0: Composable

21 Feb 01:15
Compare
Choose a tag to compare

This minor release changes all exposed abstract interfaces to use composition instead of inheritance.

v0.4.2: Next DSL

21 Feb 01:13
Compare
Choose a tag to compare

This patch release re-implements existing DSL to match up breaking changes from compiler version upgrade.

v0.4.1

10 Jan 00:27
Compare
Choose a tag to compare

This patch release fixes bug with abstract signatures of Reporter class, that were discovered upon upgrading version of Crystal. See #20 and #21

v0.4.0

18 Oct 20:41
Compare
Choose a tag to compare

This release includes basic ground required to actually start use this library for any test suite.

Features:

  • expect().to ... syntax by default with option to enable should on Object.
  • no global scope pollution with Spec2.describe + option to enable global describe DSL.
  • describe, context, it DSL for defining examples and example groups.
  • before and after hooks to be executed before and after each example in current and nested example groups.
  • let, let!, subject and subject! for defining example-group-scoped bindings.
  • minimal necessary list of builtin matchers (matches stdlib's spec list).
  • random order execution.
  • color and no-color output.
  • minimal and documentation reporters.
  • ability to configure almost every piece of library by using custom runner, order, reporter and/or output.
  • ability to register your own matchers.

List of implemented builtin matchers:

  • eq("hello, world") - asserts actual is equal to expected
  • raise_error(ErrorClass [, message_matcher]) - checks if block raises expected error
  • be(42) - asserts actual is the same as expected
  • match(/hello .+/) - asserts actual is matching provided regexp
  • be_true - asserts actual is equal true
  • be_false - asserts actual is equal false
  • be_truthy - asserts actual is not nil or false
  • be_falsey - asserts actual is nil or false
  • be_nil - asserts actual is equal nil
  • be_close(42, 0.01) - asserts actual is in delta-proximity of expected
  • expect(42).to_be < 45 - asserts arbitrary method call on actual to be truthy
  • be_a(String) - asserts actual to be of expected type (uses is_a?)