[ruby-core:32864] [Ruby 1.9-Bug#3972][Open] r28668 breaks test/unit when combined with the testing rake task

From: Aaron Patterson <redmine@...>
Date: 2010-10-20 20:26:13 UTC
List: ruby-core #32864
Bug #3972: r28668 breaks test/unit when combined with the testing rake task
http://redmine.ruby-lang.org/issues/show/3972

Author: Aaron Patterson
Status: Open, Priority: Normal
Assigned to: Nobuyoshi Nakada
ruby -v: ruby 1.9.3dev (2010-10-18 trunk 29530) [x86_64-darwin10.4.0]

r28668 makes Test::Unit process command line arguments even when used in conjunction with the rake test loader.  This causes every test file to be required twice.

How to reproduce:

1. Create a file "foo.rb" with a test:

require 'test/unit'

puts "HELLO!"

class Foo < Test::Unit::TestCase
  def test_whatever
    assert true
  end
end

2. Run the test using the rake test loader like this:

  $ ruby -w  "/Users/apatterson/.local/lib/ruby/1.9.1/rake/rake_test_loader.rb" "foo.rb"

You'll see "HELLO!" printed twice and warnings about methods being redefined.

Here is a video of the failure:

  http://www.youtube.com/watch?v=woj1IYnEZdA


----------------------------------------
http://redmine.ruby-lang.org

In This Thread

Prev Next