That&#39;ll learn ya to use Mocha over rSpec ;)<br><br><div class="gmail_quote">On Tue, Apr 15, 2008 at 2:27 PM, Giuseppe Bertini &lt;<a href="mailto:lists@ruby-forum.com">lists@ruby-forum.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">&gt; catch any dependencies your tests may have on each other<br>
&gt; in order to reveal brittle tests.<br>
<br>
</div>Following Ben&#39;s hint, I took out examples from the controller spec until<br>
I isolated the culprit.<br>
<br>
Briefly, I am switching from RSpec&#39;s built in mocking framework to Mocha<br>
and fixture_scenarios when necessary. I had forgotten to modify one of<br>
the examples, which still had this construct:<br>
<br>
 &nbsp;object.should_receive(:method).and_return(:a_mock)<br>
<br>
instead of Mocha&#39;s:<br>
<br>
 &nbsp;object.expects(:method).returns(:a_mock)<br>
<br>
So I have empirically learned that enabling<br>
<br>
 &nbsp;config.mock_with :mocha<br>
<br>
in /spec/spec_helper.rb and then mixing Mocha with RSpec&#39;s own<br>
mocking/stubbing messes things up in a nasty way, in the sense that<br>
failures occur all over the place with error messages that did not help<br>
me finding the bug.<br>
And again, these errors were not raised by TextMate&#39;s environment.<br>
Tricky.<br>
<br>
<br>
Thanks for the feedback!<br>
<div class="Ih2E3d">Giuseppe<br>
--<br>
Posted via <a href="http://www.ruby-forum.com/" target="_blank">http://www.ruby-forum.com/</a>.<br>
_______________________________________________<br>
</div><div><div></div><div class="Wj3C7c">rspec-users mailing list<br>
<a href="mailto:rspec-users@rubyforge.org">rspec-users@rubyforge.org</a><br>
<a href="http://rubyforge.org/mailman/listinfo/rspec-users" target="_blank">http://rubyforge.org/mailman/listinfo/rspec-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Bryan Ray<br><a href="http://www.bryanray.net">http://www.bryanray.net</a><br><br>&quot;Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.&quot;