Matt Elhotiby
Matt Elhotiby

Reputation: 44066

Rspec not running on an application

Ok so I am a ruby on rails developer and I am about to start trying to use the TDD (test driven development) approach and I am not sure what I am doing wrong. I have an existing app that has some rpec tests already and I am trying to figure how to run them but when i do

rake spec
(in /Users/tamer/Sites/preview)
/Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/aws-s3-0.6.2/lib/aws/s3/extensions.rb:206:in `const_missing_from_s3_library': uninitialized constant PreviewsController (NameError)
    from /Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/backward_compatibility.rb:20:in `const_missing'
    from /Users/tamer/Sites/preview/spec/controllers/previews_controller_spec.rb:3:in `<top (required)>'
    from /Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `block in load_spec_files'
    from /Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `map'
    from /Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/configuration.rb:386:in `load_spec_files'
    from /Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/command_line.rb:18:in `run'
    from /Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:55:in `run_in_process'
    from /Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:46:in `run'
    from /Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:10:in `block in autorun'
rake aborted!

(See full trace by running task with --trace)

Is there something that i am missing and what I need to do to get the previous tests to run

Upvotes: 0

Views: 341

Answers (1)

Simone Carletti
Simone Carletti

Reputation: 176402

The error is pretty self-explanatory.

uninitialized constant PreviewsController (NameError)

Chances are the PreviewsController class referenced by ./spec/controllers/previews_controller_spec.rb no longer exists in /app/controllers.

Either update the spec or remove it if the corresponding controller has been removed.

Upvotes: 3

Related Questions