gpt4 book ai didi

ruby - 自动测试、RSpec 2 和 Ruby 1.9.2-p0 - 完全没有输出

转载 作者:数据小太阳 更新时间:2023-10-29 08:01:59 26 4
gpt4 key购买 nike

我已经开始阅读 Continuous Testing with Ruby 这本书(B2.0 打印版),但遇到了紧迫的问题。在第一章中,我使用 Jeweller 1.5.1 创建了一个空的 Gem

$ jeweler --rspec twits

Running the specs manually with rake gives the correct failing output

$ 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"FFailures:  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 seconds1 example, 1 failurerake aborted!

To get Autotest configured for RSpec 2, I have created ./autotest/discover.rb in the root of my project as described in the book and elsewhere with the following contents:

Autotest.add_discovery { "rspec2" }

但是当我尝试通过自动测试 (ZenTest 4.4.0) 运行 RSpec (2.2.0) 规范时,我根本没有得到任何输出。

$ autotest

这都是通过 RVM (1.0.2) 使用 Ruby 1.9.2-p0。如果我切换到 Ruby 1.8.7-p302,一切都会按预期进行。

$ autotestloading autotest/rspec2bundle 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'FFailures:  1) Twits fails     Failure/Error: fail "Trying to get this working"     Trying to get this working     # ./spec/twits_spec.rb:5Finished in 0.00036 seconds1 example, 1 failure

最佳答案

=]

我创建了这个 gem,它是 Autotest 的替代品,我认为它可以帮助您解决问题。称为 InfinityTest。 (需要 RVM 好吗?)

有关详细信息,请参阅:

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

如果您有任何问题,请在 gitub 中告诉我,我会帮助您! =)

关于ruby - 自动测试、RSpec 2 和 Ruby 1.9.2-p0 - 完全没有输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4299989/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com