我已經開始練習使用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