diff options
| author | Jeremy Kemper <jeremy@bitsweat.net> | 2007-12-19 21:16:27 +0000 | 
|---|---|---|
| committer | Jeremy Kemper <jeremy@bitsweat.net> | 2007-12-19 21:16:27 +0000 | 
| commit | 0b84af9599d624f563a41bc13ed318ddc457efb1 (patch) | |
| tree | 7882901f768d1f46df5c04a558a5fc670dab9f34 | |
| parent | 40bff298898ed3e43c4cb82876680723f830c7c5 (diff) | |
| download | rails-0b84af9599d624f563a41bc13ed318ddc457efb1.tar.gz rails-0b84af9599d624f563a41bc13ed318ddc457efb1.tar.bz2 rails-0b84af9599d624f563a41bc13ed318ddc457efb1.zip | |
Revert [8392]. Closes #10568, reopens #10379.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8442 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
| -rwxr-xr-x | activerecord/lib/active_record/fixtures.rb | 15 | ||||
| -rwxr-xr-x | activerecord/test/fixtures_test.rb | 16 | 
2 files changed, 2 insertions, 29 deletions
| diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index 0da8c514d7..7a00b5bb56 100755 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -916,8 +916,6 @@ module Test #:nodoc:        end        def setup_with_fixtures -        return if @fixtures_setup -        @fixtures_setup = true          return unless defined?(ActiveRecord::Base) && !ActiveRecord::Base.configurations.blank?          if pre_loaded_fixtures && !use_transactional_fixtures @@ -949,8 +947,6 @@ module Test #:nodoc:        alias_method :setup, :setup_with_fixtures        def teardown_with_fixtures -        return if @fixtures_teardown -        @fixtures_teardown = true          return unless defined?(ActiveRecord::Base) && !ActiveRecord::Base.configurations.blank?          unless use_transactional_fixtures? @@ -967,31 +963,24 @@ module Test #:nodoc:        alias_method :teardown, :teardown_with_fixtures        def self.method_added(method) -        return if @__disable_method_added__ -        @__disable_method_added__ = true -                  case method.to_s          when 'setup'            unless method_defined?(:setup_without_fixtures)              alias_method :setup_without_fixtures, :setup -            define_method(:full_setup) do +            define_method(:setup) do                setup_with_fixtures                setup_without_fixtures              end            end -          alias_method :setup, :full_setup          when 'teardown'            unless method_defined?(:teardown_without_fixtures)              alias_method :teardown_without_fixtures, :teardown -            define_method(:full_teardown) do +            define_method(:teardown) do                teardown_without_fixtures                teardown_with_fixtures              end            end -          alias_method :teardown, :full_teardown          end -         -        @__disable_method_added__ = false        end        private diff --git a/activerecord/test/fixtures_test.rb b/activerecord/test/fixtures_test.rb index deeb391e3a..c1e79b807f 100755 --- a/activerecord/test/fixtures_test.rb +++ b/activerecord/test/fixtures_test.rb @@ -324,22 +324,6 @@ 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 | 
