【问题标题】:Autotest-4.4.6/ZenTest-4.4.1 broken with Rspec2 and Rails3Autotest-4.4.6/ZenTest-4.4.1 被 Rspec2 和 Rails3 破坏
【发布时间】:2010-12-04 16:08:09
【问题描述】:

ZenTest 和 Autotest 已于 12 月 1 日更新。升级到最新版本 (Autotest-4.4.6/ZenTest-4.4.1) 后,autotest 不会发现我的规格并尝试运行标准单元测试。自动测试的输出如下:
xto@Cygnus:~/projects/ruby/hibou$ autotest (Not running features. To run features in autotest, set AUTOFEATURE=true.) /home/xto/.rvm/rubies/ruby-1.9.2-p0/bin/ruby -I.:lib:test -rubygems -e "%w[test/unit test/test_helper.rb].each { |f| require f }" | unit_diff -u

降级到 Autotest-4.4.5/ZenTest-4.4.0 修复了问题...

任何提示将不胜感激...

【问题讨论】:

  • 忘了说我使用的是 Ruby 1.9.2p0

标签: ruby ruby-on-rails-3 rspec2 autotest zentest


【解决方案1】:

通过'autotest -s rspec2'运行它(使用最新的自动测试和zentest)

【讨论】:

  • 这对我有用。 Ruby 1.9.2-p0 上的 ZenTest 4.4.1(自动测试现在已弃用)
  • 太好了!那我今晚试试看:D
  • 谢谢,为我节省了半个小时来寻找这个解决方案
【解决方案2】:

您是否尝试使用 RSPEC=true 运行自动测试?像这样的 RSPEC=true autotest

【讨论】:

  • 刚刚尝试过,不幸的是,输出是一样的:xto@Phoenix:~/projects/ruby/hibou$ autotest RSPEC=true(未运行功能。要在自动测试中运行功能,请设置 AUTOFEATURE=是的。) /home/xto/.rvm/rubies/ruby-1.9.2-p0/bin/ruby -I.:lib:test -rubygems -e "%w[test/unit test/test_helper.rb].each { |f| 需要 f }" | unit_diff -u 加载套件 -e 开始 0.002613 秒内完成。 0 次测试,0 次断言,0 次失败,0 次错误,0 次跳过 测试运行选项:--seed 49902
【解决方案3】:

我刚刚将 ZenTest 升级到 4.4.2 并且自动测试工作没有在 CLI 上指定任何参数。

【讨论】:

  • ZenTest 4.5.0,我不得不使用 autotest -s rspec2 让它工作
【解决方案4】:

您可能在 Rails.root 中没有 .rspec 文件,因此 autotest 不知道您的规格。您可以通过 runnig 生成它:rails generate rspec:install

并且您需要在 Gemfile 中包含 gem 'autotest-rails(在 gem 'ZenTest' 旁边)。

安装说明如下:http://relishapp.com/rspec/rspec-rails/v/2-5/file/autotest

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2010-09-13
    • 1970-01-01
    • 1970-01-01
    • 2011-08-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多