On Tuesday, February 18, 2014 6:30:34 AM UTC-8, Dan Bernier wrote:
>
> Could a spec with no expectations automatically pend, or fail? possibly 
> controlled via a flag?
>
>     it 'should have muffins'
>       baker.has_muffins?    # <- a quick scan makes this look right
>       expect(baker.has_muffins?).to be_true  # <- but you need this
>     end
>
>     $ rspec   # The empty spec passes
>     $ rspec --fail-empty-specs   # The empty spec fails
>     $ rspec --pend-empty-specs  # The empty spec pends
>
> In an ideal world, this would be unneeded. But when you work on a large 
> code base, and you're interrupted, it's pretty easy to make this mistake.
>
> -- 
> twitter @danbernier
> http://wordcram.org | http://newhaven.io
>

This has been discussed several times before:

https://github.com/rspec/rspec-core/issues/759
https://github.com/rspec/rspec-core/issues/591
https://github.com/rspec/rspec-core/issues/404

I just reopened #759 as I'm more onboard with adding this than before. 
 Let's continue discussion there.

BTW, here's a way you can get this now:

http://blog.sorah.jp/2012/12/17/rspec-warn-for-no-expectations

Myron

-- 
You received this message because you are subscribed to the Google Groups 
"rspec" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rspec/10eb624f-c15f-48b7-b634-b7a92ff54f02%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to