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 trialChrist khodabakhshi
10,916 Pointsbin/rake spec does not work after integration tests
Christs-Air:odot christkhodabakhshi$ bin/rake spec
/Users/christkhodabakhshi/.rbenv/versions/2.1.3/bin/ruby -S rspec ./spec/controllers/todo_lists_controller_spec.rb ./spec/features/todo_lists/create_spec.rb ./spec/features/todo_lists/destroy_spec.rb ./spec/features/todo_lists/edit_spec.rb ./spec/helpers/todo_lists_helper_spec.rb ./spec/models/todo_list_spec.rb ./spec/requests/todo_lists_spec.rb ./spec/routing/todo_lists_routing_spec.rb ./spec/views/todo_lists/edit.html.erb_spec.rb ./spec/views/todo_lists/index.html.erb_spec.rb ./spec/views/todo_lists/new.html.erb_spec.rb ./spec/views/todo_lists/show.html.erb_spec.rb
/Users/christkhodabakhshi/projects/odot/spec/helpers/todo_lists_helper_spec.rb:16:in `<top (required)>': undefined local variable or method `config' for main:Object (NameError)
from /Users/christkhodabakhshi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:241:in `load'
from /Users/christkhodabakhshi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:241:in `block in load'
from /Users/christkhodabakhshi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:232:in `load_dependency'
from /Users/christkhodabakhshi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:241:in `load'
from /Users/christkhodabakhshi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `block in load_spec_files'
from /Users/christkhodabakhshi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `each'
from /Users/christkhodabakhshi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/configuration.rb:1065:in `load_spec_files'
from /Users/christkhodabakhshi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/command_line.rb:18:in `run'
from /Users/christkhodabakhshi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:103:in `run'
from /Users/christkhodabakhshi/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/rspec-core-2.99.2/lib/rspec/core/runner.rb:17:in `block in autorun'
/Users/christkhodabakhshi/.rbenv/versions/2.1.3/bin/ruby -S rspec ./spec/controllers/todo_lists_controller_spec.rb ./spec/features/todo_lists/create_spec.rb ./spec/features/todo_lists/destroy_spec.rb ./spec/features/todo_lists/edit_spec.rb ./spec/helpers/todo_lists_helper_spec.rb ./spec/models/todo_list_spec.rb ./spec/requests/todo_lists_spec.rb ./spec/routing/todo_lists_routing_spec.rb ./spec/views/todo_lists/edit.html.erb_spec.rb ./spec/views/todo_lists/index.html.erb_spec.rb ./spec/views/todo_lists/new.html.erb_spec.rb ./spec/views/todo_lists/show.html.erb_spec.rb failed
2 Answers
Brandon Barrette
20,485 PointsThere error is here:
todo_lists_helper_spec.rb:16
Line 16 of your todo_lists_helper_spec.rb file.
Maciej Czuchnowski
36,441 PointsThere's something wrong with line 16 in this file: /projects/odot/spec/helpers/todo_lists_helper_spec.rb
Christ khodabakhshi
10,916 PointsChrist khodabakhshi
10,916 PointsThe problem solved when I deleted
config.expose_current_running_example_as :example
from spec/helpers/todo_lists_helper_spec.rb
I added that to remove warning from spec test. it was wrong ? or ...
Brandon Barrette
20,485 PointsBrandon Barrette
20,485 PointsYou should add that code to your spec_helper.rb file or rails_helper.rb file if you are using rspec 3. This will remove the depreciation warnings you see in the terminal.