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

Allow pending to be used without blocks #6732

Merged
merged 3 commits into from
Sep 17, 2018

Conversation

tswicegood
Copy link
Contributor

Both it and pending can be used in RSpec without a block. Calling it without a block is a way of specifying that it is pending. I was caught off guard when writing a spec and it failed in both instances because I lacked a block.

Both `it` and `pending` can be used in RSpec without a block. Calling
`it` without a block is a way of specifying that it is pending. I
was caught off guard when writing a spec and it failed in both instances
because I lacked a block.
spec/std/spec_spec.cr Outdated Show resolved Hide resolved
@RX14
Copy link
Contributor

RX14 commented Sep 16, 2018

pending without a block, yes. it without a block, no.

@straight-shoota
Copy link
Member

Is the it overload really required? Why not just use pending everywhere? It's essentially an alias...

@RX14
Copy link
Contributor

RX14 commented Sep 16, 2018

it is an alias

I'm pulling these at the request of @asterite. Doesn't really make
sense to have them here as there's no way other than manual verification
to ensure that they have the intended behavior.
@tswicegood
Copy link
Contributor Author

@straight-shoota, @RX14 the documented way to mark tests as incomplete in RSpec is to write it "should do something" without the block. I imagine I'm not the only one who'd try to write out a bunch of pending tests via it … and no block and be surprised at a failure.

@asterite
Copy link
Member

Yes, but this is not RSpec and Crystal tries to avoid aliases. I guess anyone will be surprised to find out there's no let, before each, etc.

@tswicegood
Copy link
Contributor Author

In fairness, @asterite – when I came across no it as pending, the first thing I tried was rewriting it to pending, so I guess most folk's figure it out. 😄

I'll remove the new it signature and push up the changes. Hopefully it'll run this time. Not sure what's up with those failed tests. Looks like they timed out.

Summerizing here: Crystal's Spec isn't RSpec. There's enough slight
changes that having to write `pending` without a block won't be a
huge deal.
@RX14 RX14 added this to the 0.27.0 milestone Sep 17, 2018
@RX14 RX14 merged commit 94f76a1 into crystal-lang:master Sep 17, 2018
@tswicegood tswicegood deleted the feature/allow-it-with-no-block branch September 17, 2018 15:07
ezrast pushed a commit to ezrast/crystal that referenced this pull request Oct 2, 2018
@bcardiff bcardiff changed the title Allow it and pending to be used without blocks Allow pending to be used without blocks Oct 25, 2018
RX14 pushed a commit to RX14/crystal that referenced this pull request Oct 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants