1

Rails アプリに新しい (普通の) Ruby クラスを追加しています。クラスの最小限の単体テストがあります。

require 'minitest_helper'
class ReportOptionTest < MiniTest::Unit::TestCase
  def setup
    @report_option = Cmdx::ReportGenerator::ReportOption.new( "testing123" )
  end

  def test_depends_on
    assert @report_option.depends_on.empty?
  end
end

このテストだけを rake で実行すると、期待どおりに実行されますが、実行されなかったのは6 回です。

$ time rake test TEST=test/unit/report_generator/report_option_test.rb 
Rack::File headers parameter replaces cache_control after Rack 1.5.
Run options: --seed 64427

# Running tests:
.

Finished tests in 0.003272s, 305.6309 tests/s, 305.6309 assertions/s.

1 tests, 1 assertions, 0 failures, 0 errors, 0 skips
Rack::File headers parameter replaces cache_control after Rack 1.5.
Run options: --seed 17980

# Running tests:
.

Finished tests in 0.003284s, 304.4809 tests/s, 304.4809 assertions/s.

1 tests, 1 assertions, 0 failures, 0 errors, 0 skips
Rack::File headers parameter replaces cache_control after Rack 1.5.
Run options: --seed 45845

# Running tests:
.

Finished tests in 0.003267s, 306.0590 tests/s, 306.0590 assertions/s.

1 tests, 1 assertions, 0 failures, 0 errors, 0 skips
Rack::File headers parameter replaces cache_control after Rack 1.5.
Run options: --seed 49526

# Running tests:
.

Finished tests in 0.003258s, 306.9620 tests/s, 306.9620 assertions/s.

1 tests, 1 assertions, 0 failures, 0 errors, 0 skips
Rack::File headers parameter replaces cache_control after Rack 1.5.
Run options: --seed 53716

# Running tests:
.

Finished tests in 0.003246s, 308.1155 tests/s, 308.1155 assertions/s.

1 tests, 1 assertions, 0 failures, 0 errors, 0 skips
Rack::File headers parameter replaces cache_control after Rack 1.5.
Run options: --seed 44898

# Running tests:
.

Finished tests in 0.003272s, 305.6556 tests/s, 305.6556 assertions/s.

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

real   0m34.999s
user   0m32.034s
sys    0m1.440s

このページでも同様の問題が言及されていることに注意してください。何が起こっているのかわかりません。また、テストを 1 回だけ実行するために変更する必要がある構成設定があるかどうか、率直に言って、テストの実行をより速く完了するにはどうすればよいかわかりません。

バージョン:

$ ruby -v
ruby 1.9.3p362 (2012-12-25 revision 38607) [x86_64-linux]
$ rake -V
rake, version 10.0.3
$ rails -v
Rails 3.2.12
4

0 に答える 0