【问题标题】:Ruby + Testunit + ci_reporter: No xml outputRuby + Testunit + ci_reporter:没有 xml 输出
【发布时间】:2012-05-28 21:38:47
【问题描述】:

我有以下 Rakefile:

require 'rake'

gem 'ci_reporter'
require 'ci/reporter/rake/test_unit'

task :test do
  ruby 'signup.rb'
end

还有以下文件:

require 'rubygems'
require 'test/unit'

class SignupTest < Test::Unit::TestCase
    def test_signup
        assert true
    end
end

当我运行“rake ci:setup:testunit test”时,我得到:

rm -rf test/reports
/Users/fernando/.rvm/rubies/ruby-1.9.3-p0/bin/ruby signup.rb
Run options: 

# Running tests:

.

Finished tests in 0.000820s, 1219.5122 tests/s, 1219.5122 assertions/s.

1 tests, 1 assertions, 0 failures, 0 errors, 0 skips

似乎它应该在 test/reports 中生成了某种内容,但该目录不存在。

对我应该做什么有什么想法吗?

【问题讨论】:

  • @Trejkaz 这是这个问题的链接:)
  • 是的。我以为我复制了一个链接,指向某人发布的关于它的问题。我的坏...现在我也找不到原件。 :(
  • @Fernando 你解决了这个问题吗?我和你遇到了同样的问题
  • @Dan 不。无法让它工作。我最终使用了这个 gem github.com/nicksieger/ci_reporter
  • @Fernando 您链接到给您带来麻烦的宝石。是不是搞错了?

标签: ruby testunit


【解决方案1】:

尝试将要求行更改为:

gem 'ci_reporter'
require 'ci/reporter/rake/test_unit_loader'

(我在 MiniTest 中遇到过类似的问题,文档说需要 minitest,但我发现有一个 minitest_loader 并且要求它有效!)

【讨论】:

    【解决方案2】:

    我遇到了同样的问题。

    试试这个:

    • 将以下要求添加到您的 test.rb 中:require 'test/unit'

      require 'ci/reporter/rake/test_unit_loader' gem 'test-unit'

    • 将以下要求添加到您的 rakefile.rb 中:require 'ci/reporter/rake/test_unit' #http://juretta.com/log/2008/11/11/hudson_test_drive_part_1_rails/

    • 使用 cmd 执行:rake CI_REPORTS=reports test

    希望这会对你有所帮助,它对我有用。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-12-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多