diff options
author | Rick Olson <technoweenie@gmail.com> | 2007-12-15 01:23:05 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2007-12-15 01:23:05 +0000 |
commit | abd7cf343c3f43516d25e3b787e96af38d12ebf4 (patch) | |
tree | 0cbbcdc46e53c34ea86c91f66f71d5986e7af8c5 /activerecord/test | |
parent | 1ceccdeb7f86898a9e511e934ea6b0863d30590d (diff) | |
download | rails-abd7cf343c3f43516d25e3b787e96af38d12ebf4.tar.gz rails-abd7cf343c3f43516d25e3b787e96af38d12ebf4.tar.bz2 rails-abd7cf343c3f43516d25e3b787e96af38d12ebf4.zip |
Make the Fixtures Test::Unit enhancements more supporting for double-loaded test cases. Closes #10379 [brynary]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8392 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
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 |