[rspec-users] removing Mocha; 'spec spec' fails but the specific model file passes

Doug dgoldie15 at gmail.com
Sat Jun 13 17:30:08 EDT 2009

I happened to mix ryan bates' authentication scaffold with
rspec_scaffold on a  demo project.
and ran into the problem of mixing mock frameworks...ryan uses mocha.

So, as a learning experience, I choose to redo ryan's tests without
mocha but ran into a strange problem with tests of the User model.

With debugging you can see....
If you run just the user_spec.rb file, everything is fine....rspec
goes through the User model.
However, if you run all the specs, it is somehow still using mocha
instead of the User model.

How is this possible since I removed the configuration for mocha.?

In spec_helper.rb, I commented out the   line: #
config.mock_with :mocha
I also saw a require 'mocha' statement in test_helper that I removed.


11:41 /c/work/quizmaker_demo (questions)$ spec spec
User.authenticate('nonexisting', 'secret').should be_nil
(rdb:1) s
stubbee.__metaclass__.class_eval("def #{method}(*args, &block);
mocha.method_missing(:#{method}, *a
(rdb:1) c

More information about the rspec-users mailing list