Changelog for hspec-2.7.7

Changes in 2.7.7

Changes in 2.7.6

Changes in 2.7.5

Changes in 2.7.4

Changes in 2.7.3

Changes in 2.7.2

Changes in 2.7.1

Changes in 2.7.0

Changes in 2.6.1

Changes in 2.6.0

Changes in 2.5.9

Changes in 2.5.8

Changes in 2.5.7

Changes in 2.5.6

Changes in 2.5.5

Changes in 2.5.4

Changes in 2.5.3

Changes in 2.5.2

Changes in 2.5.1

Changes in 2.5.0

Changes in 2.4.8

Changes in 2.4.7

Changes in 2.4.6

Changes in 2.4.5

Changes in 2.4.4

Changes in 2.4.3

Changes in 2.4.2

Changes in 2.4.1

Changes in 2.4.0

Internal changes:

Changes in 2.3.2

Changes in 2.3.1

Changes in 2.3.0

Changes in 2.2.4

Changes in 2.2.3

Changes in 2.2.2

Changes in 2.2.1

Changes in 2.2.0

Changes in 2.1.10

Changes in 2.1.9

Changes in 2.1.8

Changes in 2.1.7

Changes in 2.1.6

Changes in 2.1.5

Changes in 2.1.4

Changes in 2.1.3

Changes in 2.1.2

Changes in 2.1.1

Changes in 2.1.0

Changes in 2.0.2

Changes in 2.0.1

Changes in 2.0.0

Changes in 1.12.4

Changes in 1.12.3

Changes in 1.12.2

Changes in 1.12.1

Changes in 1.12.0

Changes in 1.11.4

Changes in 1.11.3

Changes in 1.11.2

Changes in 1.11.1

Changes in 1.11.0

Changes in 1.10.0

Changes in 1.9.5

Changes in 1.9.4

Changes in 1.9.3

Changes in 1.9.2

Changes in 1.9.1

Changes in 1.9.0

Changes in 1.8.3

Changes in 1.8.2

Changes in 1.8.1

Changes in 1.8.0

Changes in 1.7.2

Changes in 1.7.1

Changes in 1.7.0

Change in 1.6.2

Changes in 1.6.1

Changes in 1.6.0

Changes in 1.5.4

Changes in 1.5.3

Changes in 1.5.2

Changes in 1.5.1

Changes in 1.5.0

Changes in 1.4.5

Changes in 1.4.4

Changes in 1.4.3

Changes in 1.4.2

Changes in 1.4.1

Changes in 1.4.0

Changes in 1.3.0

Changes in 1.2.0

Changes in 1.1.3

Changes in 1.1.2

Changes in 1.1.1

Changes in 1.1.0

The reason for pending examples is now optional

With this change, both of the following code snippets work.

it "some behavior" $
  pending  -- no reason given
it "some other behavior" $
  pending "some reason"

Hspec does not rely on ExistentialQuantification anymore

The type used to represent specs is now abstract

This should give more useful error messages when adapting old specs that use the non-monadic API for hspec-1.0/hspec-1.1.

Several internal types and functions have been deprecated

Those are internal functions, and they will be removed/hidden with the next release. If you use any of those, update your code. If you really need them, open a ticket and describe your use case.

Changes in 1.0.0

Hspec now re-uses QuickCheck's property function

Test.Hspec.QuickCheck.property is now simply a re-exports of Test.QuickCheck.property. This has the advantage that you do not get a name collision if you import both, Test.Hspec.QuickCheck and Test.QuickCheck.

Better support for nested specs

NOTE: This is a breaking change to the non-monadic API. The monadic API is not affected.

In some situations parent descriptions for nested specs were not included in the generated report. Solving this required a change to the data structure that is used to represent specs (it was not a proper tree, now it is).

Updating specs that use the non-monadic API

The runner functions (hspec, hspecB and hspecX) now take a list of descriptions.

The following works with hspec-0.9, but not with hspec-1.0.

main = hspecX $
  describe "reverse" [
    it "reverses a list" $
      reverse [1, 2, 3] == [3, 2, 1],

    it "gives the original list, if applied twice" $ property $
      \xs -> reverse (reverse xs) == (xs :: [Int])
  ]

For hspec-1.0, you need to wrap it into a list.

main = hspecX [
    describe "reverse" [
      it "reverses a list" $
        reverse [1, 2, 3] == [3, 2, 1],

      it "gives the original list, if applied twice" $ property $
        \xs -> reverse (reverse xs) == (xs :: [Int])
    ]
  ]

Specs consisting of several desribes, combined with descriptions, continue to work unchanged. But descriptions is now a noop, and it will be removed in a future release. So it is a good idea to drop it.

The following works with both hspec-0.9 and hspec-1.0.

main = hspecX $ descriptions [  -- descriptions is redundant
    describe "Foo" [
      it "has some behavior" True
    ]
  , describe "Bar" [
      it "has some behavior" True
    ]
  ]

But the following is recommended instead.

main = hspecX [
    describe "Foo" [
      it "has some behavior" True
    ]
  , describe "Bar" [
      it "has some behavior" True
    ]
  ]

A new monadic API for custom Formatters

For all the details, have a look at the [docs] (http://hackage.haskell.org/packages/archive/hspec/latest/doc/html/Test-Hspec-Formatters.html).

The total time required to run a spec is now included in the summary

In addition to the used CPU time, the total time required to run a spec is now include in the summary. This is useful for specs that do non-CPU-intensive stuff, or fork subprocesses.