diff options
Diffstat (limited to 'activerecord/test')
-rwxr-xr-x | activerecord/test/fixtures_test.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/activerecord/test/fixtures_test.rb b/activerecord/test/fixtures_test.rb index c1e79b807f..deeb391e3a 100755 --- a/activerecord/test/fixtures_test.rb +++ b/activerecord/test/fixtures_test.rb @@ -324,6 +324,22 @@ class MultipleFixturesTest < Test::Unit::TestCase end end +# This is to reproduce a bug where if a TestCase is loaded +# twice by Ruby, it loses its fixture setup hook. +class_def = <<-CODE + class DoubleLoadedTestCase < Test::Unit::TestCase + fixtures :topics + + def setup + end + + def test_should_properly_setup_fixtures + assert_nothing_raised { topics(:first) } + end + end +CODE +2.times { eval(class_def) } + class OverlappingFixturesTest < Test::Unit::TestCase fixtures :topics, :developers fixtures :developers, :accounts |