[rspec-users] How do BOTH these examples pass?
raasdnil at gmail.com
Wed Oct 1 09:36:02 EDT 2008
On Wed, Oct 1, 2008 at 11:26 PM, Ashley Moran
<ashley.moran at patchspace.co.uk> wrote:
> *does* pass the specs, both the one that says parse should be called, and
> the one that say it shouldn't! But why? I'm prepared to admit I'm just
> missing something really really really obvious (it happens often), but how
> both pass, under any circumstances?
Oh... I see what you are saying now....
When I have had something like this in the past, I refactor my spec
code to not use any nesting at all and put all the pre conditions
inside of the it should block, that way you are sure you are not
getting some weird edge case on something.
Try it out.
it "should not pass" do
every setup thing from every before block in here
do the action
See what comes of that.
Rails, RSpec and Life blog....
More information about the rspec-users