【发布时间】:2012-02-09 13:52:28
【问题描述】:
好吧,我是一名 ruby on rails 开发人员,我即将开始尝试使用 TDD(测试驱动开发)方法,但我不确定自己做错了什么。我有一个现有的应用程序已经进行了一些 rpec 测试,我正在尝试弄清楚如何运行它们,但是当我这样做时
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)
我有什么遗漏以及我需要做些什么来运行之前的测试
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 unit-testing rspec tdd