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 Write Our First Tests

Leonardo Cavalcanti
Leonardo Cavalcanti
5,308 Points

spec.rb error! 1 example, 1 failure

I ran "bin/rspec spec/features/todo_lists/create_spec.rb" uploaded the code from file spec.rb on pastebin:
http://pastebin.com/erg5t801

and im getting this error message from the terminal:

Finished in 0.00012 seconds
1 example, 1 failure
/usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.1.0/lib/rspec/core/hooks.rb:116:in `run_hook_filtered': undefined method `run_all' for []:Array (NoMethodError)
    from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.1.0/lib/rspec/core/example_group.rb:214:in `eval_after_alls'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.1.0/lib/rspec/core/example_group.rb:237:in `run'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.1.0/lib/rspec/core/command_line.rb:27:in `block (2 levels) in run'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.1.0/lib/rspec/core/command_line.rb:27:in `map'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.1.0/lib/rspec/core/command_line.rb:27:in `block in run'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.1.0/lib/rspec/core/reporter.rb:12:in `report'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.1.0/lib/rspec/core/command_line.rb:24:in `run'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.1.0/lib/rspec/core/runner.rb:55:in `run_in_process'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.1.0/lib/rspec/core/runner.rb:46:in `run'
    from /usr/local/lib/ruby/gems/1.9.1/gems/rspec-core-2.1.0/lib/rspec/core/runner.rb:10:in `block in autorun'
leo@leo-desktop:~/Documents/mega_project/odot$

SOmeone help? is this due to my rails version which is 4.2.4 ?

3 Answers

Leonardo Cavalcanti
Leonardo Cavalcanti
5,308 Points

Yeah.... maybe i should post this on stackoverflow...

Leonardo Cavalcanti
Leonardo Cavalcanti
5,308 Points

heres the file again as it didnt display correctly http://pastebin.com/erg5t801

John Steer-Fowler
PLUS
John Steer-Fowler
Courses Plus Student 11,734 Points

Hey Leonardo,

This looks like a bug in Rspec, although when I looked into it, it seems to have been fixed back in 2010

Very strange. Maybe it has resurfaced.

I will continue to look into it and get back to you

John Steer-Fowler
John Steer-Fowler
Courses Plus Student 11,734 Points

Do you have the latest versions of Rails, Ruby and Rspec?

Leonardo Cavalcanti
Leonardo Cavalcanti
5,308 Points

Rails 4.2.4 ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux] rspec -v 2.99.2

John Steer-Fowler
John Steer-Fowler
Courses Plus Student 11,734 Points

No idea why it's not working then. I did this same course with similar versions and it worked fine.

Going to continue to look into it, but there's not a lot online on this issue.