[rspec-devel] [ rspec-Feature Requests-8149 ] specify_negatively

noreply at rubyforge.org noreply at rubyforge.org
Thu Jan 25 13:55:31 EST 2007


Feature Requests item #8149, was opened at 2007-01-25 20:55
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=8149&group_id=797

Category: runner module
Group: None
Status: Open
Priority: 3
Submitted By: Yurii Rashkovskii (yrashk)
Assigned to: Nobody (None)
Summary: specify_negatively

Initial Comment:
The idea is pretty simple: to let declare some specifications as those that _should_ fail:

context "Math behaviour" do

  specify "addition should give you the right answer" do
    (2+2).should == 4
  end

  specify_negatively "addition should not give you the wrong answer (should fail)" do
    (2+2).should == 5
  end

  specify_negatively "addition should not give you the wrong answer (bad negative test)"" do
    (2+2).should == 4
  end

end


Math behaviour
- addition should give you the right answer
- addition should not give you the wrong answer (should fail)
- addition should not give you the wrong answer (bad negative test) (FAILED - 1)

1)
'addition should not give you the wrong answer (bad negative test)' FAILED
This specification was expected to fail, but nothing failed

Finished in 0.041288 seconds

3 specifications, 1 failure


You can read discussion here:
http://rashkovskii.com/articles/2007/1/25/rspec-specify_negatively

----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=8149&group_id=797


More information about the rspec-devel mailing list