Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to mark entire describe or context blocks as pending #252

Closed
glittershark opened this issue Jan 14, 2016 · 4 comments
Closed

Ability to mark entire describe or context blocks as pending #252

glittershark opened this issue Jan 14, 2016 · 4 comments

Comments

@glittershark
Copy link

It'd be nice to be able to mark entire describe or context blocks as pending, either by prefixing them with an x a-la rspec or just calling pending somewhere in the do-body of the block.

@jetpacmonkey
Copy link

+1

@sol
Copy link
Member

sol commented Jan 29, 2016

This can already be done with something like

spec = before_ pending $ do
  describe "...

With this you can easily define xit and xdescribe, e.g.:

xit :: Example a => String -> a -> SpecWith (Arg a)
xit s = before_ pending . it s

xdescribe :: String -> SpecWith a -> SpecWith a
xdescribe s = before_ pending . describe s

I'm happy to accept a PR that adds xit and xdescribe.

@lslah
Copy link

lslah commented Feb 2, 2016

While trying to add xit and xdescribe I noticed that the following spec would report one failing test instead of one pending test:

spec :: Spec
spec = before_ pending $ it "should be pending" False
Data.String.Strip
  should be pending FAILED [1]

Failures:

  test/Data/String/StripSpec.hs:9:
  1) Data.String.Strip should be pending

Randomized with seed 427512909

Finished in 0.0003 seconds
1 example, 1 failure

In contrast, the next spec works as expected:

spec :: Spec
spec = before_ pending $ it "should be pending" $ False `shouldBe` True
Data.String.Strip
  should be pending
     # PENDING: No reason given

Finished in 0.0002 seconds
1 example, 0 failures, 1 pending

Is this behaviour expected and desired?

sol added a commit that referenced this issue Oct 25, 2016
sol added a commit that referenced this issue Oct 25, 2016
sol added a commit that referenced this issue Oct 26, 2016
sol added a commit that referenced this issue Oct 26, 2016
sol added a commit that referenced this issue Oct 26, 2016
sol added a commit that referenced this issue Oct 26, 2016
sol added a commit that referenced this issue Oct 26, 2016
sol added a commit that referenced this issue Oct 26, 2016
@sol
Copy link
Member

sol commented Oct 26, 2016

@lslah given that Bool-examples are both pure and rarely used, I did not consider it crucial enough to invest my time to implement support for around-hooks for them. It's fixed on master now.

@sol sol closed this as completed Oct 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants