[Rspec-devel] Mocha and TestCase#add_assertion

James Mead jamesmead44 at gmail.com
Tue Sep 12 04:57:53 EDT 2006


I had a query on the Mocha mailing list this morning from someone who is
using RSpec and Mocha plugins. He was seeing an error which looks to be down
to RSpec raising an exception when add_assertion is called. Mocha uses
add_assertion to include verified expectations in the assertion count. My
colleague Chris Roos gives the following tests as an illustration of the
problem.

# normal test, no errors
def test_abc
  add_assertion
end

# rspec spec, raises nil.add_assertion
spec "should blah" do
  add_assertion
end

I haven't looked into it any further, but does anyone have any ideas? I
suggested he patched his version of Mocha to rescue the exception, but told
him I wasn't sure of the ramifications on the RSpec side.

-- 
James.
http://blog.floehopper.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/rspec-devel/attachments/20060912/2b6130f0/attachment.html 


More information about the rspec-devel mailing list