2010-11-29 39 views
2

我已经开始练习使用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 

回答

0

注意到斜体强调自动测试在此wiki page,我卸载ZenTest(4.4.0)宝石和安装,而不是自动测试(4.4.5)的宝石。之后和

$ bundle install 

东西都在这两个红宝石1.9.2-P0和Ruby正常工作1.8.7-P302

 
$ autotest 
loading autotest/rspec2 
style: Rspec2 
bundle exec /Users/mfurtak/.rvm/rubies/ruby-1.9.2-p0/bin/ruby -S /Users/mfurtak/.rvm/gems/ruby-1.9.2-p0/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:in `block (2 levels) in ' 

Finished in 0.00036 seconds 
1 example, 1 failure 
1

=]

我创造了这个宝石那就是自动测试的替代方案,我想将您的问题有所帮助。 称为InfinityTest。 (RVM需要OK?)

欲了解更多信息,请参阅:

https://github.com/tomas-stefano/infinity_test

如果你有任何问题,让我知道在那gitub我来帮你! =)