Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialScott Wilcox
9,517 PointsGetting warnings when running test.
I am getting this when I run the first test.
D:\Development\projects\odot>rspec spec\models\todo_item_spec.rb
Active code page: 437
Warning: you should require 'minitest/autorun' instead.
Warning: or add 'gem "minitest"' before 'require "minitest/autorun"'
From:
C:/Ruby200/lib/ruby/gems/2.0.0/gems/shoulda-matchers-2.4.0/lib/shoulda/matchers/assertion_error.rb:10:in require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/shoulda-matchers-2.4.0/lib/shoulda/matchers/assertion_error.rb:10:in
<module:Matchers>'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/shoulda-matchers-2.4.0/lib/shoulda/matchers/assertion_error.rb:2:in <module:Shoulda>'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/shoulda-matchers-2.4.0/lib/shoulda/matchers/assertion_error.rb:1:in
<top (required)>'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/shoulda-matchers-2.4.0/lib/shoulda/matchers.rb:2:in require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/shoulda-matchers-2.4.0/lib/shoulda/matchers.rb:2:in
<top (required)>'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/shoulda-matchers-2.4.0/lib/shoulda-matchers.rb:1:in require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/shoulda-matchers-2.4.0/lib/shoulda-matchers.rb:1:in
<top (required)>'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.9.4/lib/bundler/runtime.rb:76:in require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.9.4/lib/bundler/runtime.rb:76:in
block (2 levels) in require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.9.4/lib/bundler/runtime.rb:72:in each'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.9.4/lib/bundler/runtime.rb:72:in
block in require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.9.4/lib/bundler/runtime.rb:61:in each'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.9.4/lib/bundler/runtime.rb:61:in
require'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/bundler-1.9.4/lib/bundler.rb:134:in require'
D:/Development/projects/odot/config/application.rb:7:in
<top (required)>'
D:/Development/projects/odot/config/environment.rb:2:in <top (required)>'
D:/Development/projects/odot/spec/spec_helper.rb:3:in
<top (required)>'
D:/Development/projects/odot/spec/models/todo_item_spec.rb:1:in <top (required)>'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in
load'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in block in load_spec_files'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in
each'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in load_spec_files'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/command_line.rb:18:in
run'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:103:in run'
C:/Ruby200/lib/ruby/gems/2.0.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:17:in
block in autorun'
.
Finished in 0.0156 seconds 1 example, 0 failures
Randomized with seed 63429
I know it doesn't fail but what is all this other stuff?
6 Answers
Andrew Stelmach
12,583 PointsTake a look at this - should help:
https://github.com/thoughtbot/shoulda-matchers/issues/408
Found it by copy/pasting your error code into google, preceded by 'rails'. Post back here if you solve it or if you get really stuck.
Andrew Stelmach
12,583 PointsAre you running this in Treehouse workspaces or on your own setup?
Scott Wilcox
9,517 PointsThat did fix the issue with the test and the errors are now gone. thank you.
You should also add
gem minitest before the gem shoulda-matchers
group :test do gem 'capybara', '~> 2.1.0' gem 'minitest', '~> 5.6.1' gem 'shoulda-matchers', '~> 2.4.0'
Scott Wilcox
9,517 PointsA quick fix seems to be replacing the require 'minitest/unit' with require 'minitest' in lib/shoulda/matchers/assertion_error.rb since minitest/autorun includes a whole lot of other stuff.
Scott Wilcox
9,517 PointsI am running my own setup since I will be developing a targeted social networks site here in the near future.
jasonleonhard
3,424 Points group :test do
gem 'capybara', '~> 2.1.0'
gem 'minitest'
gem 'shoulda-matchers', '~> 2.4.0'
end