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 trial

Ruby Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Relationships

Getting 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:inblock (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:inblock 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:inrequire' 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:inload' 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:ineach' 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:inrun' 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:inblock 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

Take 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.

Are you running this in Treehouse workspaces or on your own setup?

That 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'

A 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.

I am running my own setup since I will be developing a targeted social networks site here in the near future.

    group :test do
      gem 'capybara', '~> 2.1.0'
      gem 'minitest'
      gem 'shoulda-matchers', '~> 2.4.0'
    end