RSpec mocha warning with rails
Since some time you probably noticed ugly deprecation warning made by mocha if using rspec and rails. Usually they look like this:
*** Mocha deprecation warning: Change `require 'mocha'` to `require 'mocha/setup'`.
*** Mocha deprecation warning: Test::Unit or MiniTest must be loaded *before* Mocha.
*** Mocha deprecation warning: If you're integrating with a test library other than Test::Unit or MiniTest, you should use `require 'mocha/api'` instead of `require 'mocha'`.
There are several workarounds for this but there is also a clean solution. ;-) Just modify your Gemfile accordingly:
group :development, :test do
...
gem 'mocha', :require => 'mocha/api'
...
end
Written by Jens Grassel
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Warning
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#