我已经开始练习使用Ruby进行连续测试(B2.0打印),但遇到了即时问题。每第一章中,我一直在使用珠宝商1.5.1自动测试,RSpec 2和Ruby 1.9.2-p0 - 根本没有输出
$ jeweler --rspec twits
与耙手动运行该规范给出正确的失败输出
$ rake spec (in /Users/mfurtak/Documents/Programming/Ruby/twits) /Users/mfurtak/.rvm/rubies/ruby-1.9.2-p0/bin/ruby -S bundle exec rspec "spec/twits_spec.rb" F Failures: 1) Twits fails Failure/Error: fail "Trying to get this working" Trying to get this working # ./spec/twits_spec.rb:5:in `block (2 levels) in ' Finished in 0.00176 seconds 1 example, 1 failure rake aborted!
若要自动测试配置为2 RSpec的创建一个空的宝石,我创建./autotest/discover.rb在我的项目的根在书中和elsewhere具有以下内容描述:
但是,当我尝试通过自动测试(ZenTest 4.4.0)运行RSpec(2.2.0)规格时,我根本没有输出。
$ autotest
这都是使用Ruby 1.9.2-p0到RVM(1.0.2)。如果我切换到Ruby 1.8.7-p302,事情按预期工作。
$ autotest loading autotest/rspec2 bundle exec /Users/mfurtak/.rvm/rubies/ruby-1.8.7-p302/bin/ruby -S /Users/mfurtak/.rvm/gems/ruby-1.8.7-p302/gems/rspec-core-2.2.1/bin/rspec --tty '/Users/mfurtak/Documents/Programming/Ruby/twits/spec/twits_spec.rb' F Failures: 1) Twits fails Failure/Error: fail "Trying to get this working" Trying to get this working # ./spec/twits_spec.rb:5 Finished in 0.00036 seconds 1 example, 1 failure