[rspec-users] textmate => pass, autotest => failing specs ???

Giuseppe Bertini lists at ruby-forum.com
Tue Apr 15 15:27:03 EDT 2008


> catch any dependencies your tests may have on each other
> in order to reveal brittle tests.

Following Ben's hint, I took out examples from the controller spec until 
I isolated the culprit.

Briefly, I am switching from RSpec's built in mocking framework to Mocha 
and fixture_scenarios when necessary. I had forgotten to modify one of 
the examples, which still had this construct:

  object.should_receive(:method).and_return(:a_mock)

instead of Mocha's:

  object.expects(:method).returns(:a_mock)

So I have empirically learned that enabling

  config.mock_with :mocha

in /spec/spec_helper.rb and then mixing Mocha with RSpec's own 
mocking/stubbing messes things up in a nasty way, in the sense that 
failures occur all over the place with error messages that did not help 
me finding the bug.
And again, these errors were not raised by TextMate's environment.
Tricky.


Thanks for the feedback!
Giuseppe
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list