This project is archived and is in readonly mode.

#2145 ✓wontfix
Mike Perham

Rails tests fail in Ruby 1.9.1

Reported by Mike Perham | March 5th, 2009 @ 11:34 PM | in 2.x

This is because ActiveSupport::TestCase line 10 pulls in Test::Unit::TestCase. This file does not exist in Ruby 1.9.1.

Reproduce steps:


# Create skeleton
rails foobar
cd foobar
touch db/schema.rb

# Put this in test/unit/foo_test.rb:
require File.dirname(__FILE__) << '/../test_helper'

class FooTest < ActiveSupport::TestCase
        def test_true
                assert true
        end
end

# Run the fake test
ruby191 /usr/bin/rake

You should see a MissingSourceFile error.

Comments and changes to this ticket

  • Niels Ganser

    Niels Ganser March 6th, 2009 @ 02:15 PM

    Test::Unit is not included in Ruby 1.9 any longer but

    sudo gem191 install test-unit

    should do the trick. Thus this ticket should IMHO be set to wontfix

  • Mike Perham

    Mike Perham March 6th, 2009 @ 03:40 PM

    Then the fix is to include test-unit as a gem dependency. Rails should not be creating test infrastructure that does not work out of the box with Ruby 1.9.

  • Prem Sichanugrist (sikachu)

    Prem Sichanugrist (sikachu) January 20th, 2010 @ 05:35 PM

    • State changed from “new” to “wontfix”

    Since Rails 2.3, unit testing should be done using ActiveSupport::TestCase instead. You can confirm this behavior by generate a model, and you would see that unit testing inherits from ActiveSupport::TestCase now.

    If you still need test-unit, then you will need to install the gem.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages