I am new to Ruby on Rails and testing. When I run rake test
I get the following error:
/Users/jarvis/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/rack-1.3.4/lib/rack/backports /uri/common_192.rb:53: warning: already initialized constant WFKV_ /Users/jarvis/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/turn-0.8.3/lib/turn/autorun /minitest.rb:14:in `<top (required)>': MiniTest v1.6.0 is out of date. (RuntimeError) `gem install minitest` and add `gem 'minitest' to you test helper. from /Users/jarvis/.rvm/gems/ruby-1.9.2-p180@rails3tutorial/gems/activesupport-3.1.1/lib /active_support/dependencies.rb:240:in `require'
I did gem install minitest
and now it says to add gem 'minitest' to my test helper. Is this test/test_helper.rb
, and if so, how do I "add" minitest?
To run a Minitest test, the only setup you really need is to require the autorun file at the beginning of a test file: require 'minitest/autorun' . This is good if you'd like to keep the code small. A better way to get started with Minitest is to have Bundler create a template project for you.
Minitest is a testing tool for Ruby that provides a complete suite of testing facilities. It also supports behaviour-driven development, mocking and benchmarking. With the release of Ruby 1.9, it was added to Ruby's standard library, which increased its popularity.
Edit your Gemfile so that the gem is specified under the test group, like so:
group :test do gem "minitest" end
(Posting the solution that the OP edited into the question, but did not post as an answer)
uninstall your minitest first. gem uninstall minitest.
if you are using turn make sure the version is less 0.8.3
put those code to your bottom of your Gemfile
group :test do gem 'turn', '< 0.8.3' gem 'minitest' end
then run
bundle install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With