hedgehogqa / hedgehogqa/haskell-hedgehog-classes

Integration with hspec

Open
#41 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Haskell
Stars
57
Forks
19
PR merge metrics
No merged PRs in 30d

Description

It would be nice if `hedgehog-classes` could be integrated with other tasting frameworks, e.g. `hspec`.

Currently, when I run `lawsCheck` inside the `hspec` test suite, I see the following slightly messy output:

```
Tests
Lecture 3
Gold
Laws: Semigroup [ ]Semigroup: Associativity ✓ passed 100 tests.
Semigroup: Concatenation ✓ passed 100 tests.
Semigroup: Times ✓ passed 100 tests.
Laws: Semigroup [✔]
Laws: Monoid [ ]Monoid: Left Identity ✓ passed 100 tests.
Monoid: Right Identity ✓ passed 100 tests.
Monoid: Associativity ✓ passed 100 tests.
Monoid: Concatenation ✓ passed 100 tests.
Laws: Monoid [✔]
```

Here is my relevant test-suite code:

```haskell
describe "Gold" $ do
it "Laws: Semigroup" $
lawsCheck (semigroupLaws genGold) `shouldReturn` True
it "Laws: Monoid" $
lawsCheck (monoidLaws genGold) `shouldReturn` True
```

I see that `hedgehog` already has integration with `hspec` in the form of [hspec-hedgehog](https://hackage.haskell.org/package/hspec-hedgehog) package. The integration is done my providing relevant instances to the `PropertyT` data type.

So, I wonder, if `hedgehog-classes` can expose `PropertyT` of the underlying laws to be used with `hspec` 🤔
Or in any other way 🙂

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by examining lawsCheck and the existing hspec-hedgehog integration around PropertyT. Determine how the underlying laws could expose PropertyT or another hspec-compatible entry point, then define completion as laws running through hspec without the interleaved output shown in the report and with failures reported by hspec.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
testing-qa
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.