Skip to content

Why are Mocha stubs carrying over to all my tests?!

July 18, 2011

This problem is often caused when requiring the mocha library with bundler from your Gemfile before Test::Unit is loaded.  To avoid this in your Gemfile be sure to not require the mocha library:

gem "mocha", :require => false

Then at the bottom of test/test_helper.rb:

require "mocha"

Problem solved.

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: