Phil
Phil

Reputation: 205

Guard-rspec Rails Odd Output

I'm new to Rails and Guard and I'm watching a screencast where it seems to output the number of errors, examples, etc. However, when I run it, I recieve the following output:

    18:31:11 - INFO - Running: spec/controllers/tasks_controller_spec.rb
/Users/Phil/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/test/unit/testcase.rb:9:in `<class:TestCase>': uninitialized constant Test::Unit::TestCase::Assertions (NameError)
    from /Users/Phil/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/test/unit/testcase.rb:8:in `<module:Unit>'
    from /Users/Phil/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/test/unit/testcase.rb:4:in `<module:Test>'
    from /Users/Phil/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/test/unit/testcase.rb:3:in `<top (required)>'
    from /Users/Phil/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/test/unit.rb:5:in `<top (required)>'
    from /Users/Phil/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/test/unit/assertions.rb:4:in `<top (required)>'
    from /Users/Phil/.rvm/gems/ruby-1.9.3-p448/gems/rspec-rails-2.14.0/lib/rspec/rails/adapters.rb:3:in `<top (required)>'
    from /Users/Phil/.rvm/gems/ruby-1.9.3-p448/gems/rspec-rails-2.14.0/lib/rspec/rails.rb:11:in `<top (required)>'
    from /Users/Phil/rails/tasks/spec/spec_helper.rb:4:in `<top (required)>'
    from /Users/Phil/rails/tasks/spec/controllers/tasks_controller_spec.rb:1:in `require'
    from /Users/Phil/rails/tasks/spec/controllers/tasks_controller_spec.rb:1:in `<top (required)>'
    from /Users/Phil/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.3/lib/rspec/core/configuration.rb:896:in `load'
    from /Users/Phil/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.3/lib/rspec/core/configuration.rb:896:in `block in load_spec_files'
    from /Users/Phil/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.3/lib/rspec/core/configuration.rb:896:in `each'
    from /Users/Phil/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.3/lib/rspec/core/configuration.rb:896:in `load_spec_files'
    from /Users/Phil/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.3/lib/rspec/core/command_line.rb:22:in `run'
    from /Users/Phil/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.3/lib/rspec/core/runner.rb:80:in `run'
    from /Users/Phil/.rvm/gems/ruby-1.9.3-p448/gems/rspec-core-2.14.3/lib/rspec/core/runner.rb:17:in `block in autorun'

Am I doing something wrong?

Upvotes: 0

Views: 195

Answers (3)

Phil
Phil

Reputation: 205

Turns out, at least in my case, I had to remove the gem 'turns' and that fixed the whole thing.

Upvotes: 1

Benjamin Bouchet
Benjamin Bouchet

Reputation: 13181

In your stack trace (the whole bunch of lines you posted) you got the answer to your question.

Seek for the lines that are pointing to files located into your project, those start with the path "/Users/Phil/rails/"

The first one point to "/Users/Phil/rails/tasks/spec/controllers/tasks_controller_spec.rb" line 1 and seems to complain about the require statement. That's where you should start your investigation.

This is the basic principle of testing: you got an error, you find its location, then find its reason, and finally fix it :)

Good luck

Upvotes: 0

Peter Alfvin
Peter Alfvin

Reputation: 29419

You're seeing the output of rspec processing your spec files, which is normal. If your specs run without exception, then you'll simply see the success/failure reports. However, if your specs raise an error, then you'll the stack trace, as you're seeing in this case. You should look at the trace and determine where in your specs and/or application code your error(s) may exist.

Upvotes: 0

Related Questions