aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/fixtures_test.rb
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2008-01-05 13:34:15 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2008-01-05 13:34:15 +0000
commit139b92495fa7697cdd619c549d4c7b263562b761 (patch)
tree20589f9f23d3b19697fed12bb1bf5ce48ef595af /activerecord/test/fixtures_test.rb
parentfe66397adfb5a8057db78afcabd4d7eb0f13a783 (diff)
downloadrails-139b92495fa7697cdd619c549d4c7b263562b761.tar.gz
rails-139b92495fa7697cdd619c549d4c7b263562b761.tar.bz2
rails-139b92495fa7697cdd619c549d4c7b263562b761.zip
* Continue evolution toward ActiveSupport::TestCase and friends. #10679 [Josh Peek]
* TestCase: introduce declared setup and teardown callbacks. Pass a list of methods and an optional block to call before setup or after teardown. Setup callbacks are run in the order declared; teardown callbacks are run in reverse. [Jeremy Kemper] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8570 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/test/fixtures_test.rb')
-rwxr-xr-xactiverecord/test/fixtures_test.rb48
1 files changed, 24 insertions, 24 deletions
diff --git a/activerecord/test/fixtures_test.rb b/activerecord/test/fixtures_test.rb
index 79023ac838..bbc3e1e5a4 100755
--- a/activerecord/test/fixtures_test.rb
+++ b/activerecord/test/fixtures_test.rb
@@ -16,7 +16,7 @@ require 'fixtures/treasure'
require 'fixtures/matey'
require 'fixtures/ship'
-class FixturesTest < Test::Unit::TestCase
+class FixturesTest < ActiveSupport::TestCase
self.use_instantiated_fixtures = true
self.use_transactional_fixtures = false
@@ -204,7 +204,7 @@ class FixturesTest < Test::Unit::TestCase
end
if Account.connection.respond_to?(:reset_pk_sequence!)
- class FixturesResetPkSequenceTest < Test::Unit::TestCase
+ class FixturesResetPkSequenceTest < ActiveSupport::TestCase
fixtures :accounts
fixtures :companies
@@ -250,7 +250,7 @@ if Account.connection.respond_to?(:reset_pk_sequence!)
end
end
-class FixturesWithoutInstantiationTest < Test::Unit::TestCase
+class FixturesWithoutInstantiationTest < ActiveSupport::TestCase
self.use_instantiated_fixtures = false
fixtures :topics, :developers, :accounts
@@ -285,7 +285,7 @@ class FixturesWithoutInstantiationTest < Test::Unit::TestCase
end
end
-class FixturesWithoutInstanceInstantiationTest < Test::Unit::TestCase
+class FixturesWithoutInstanceInstantiationTest < ActiveSupport::TestCase
self.use_instantiated_fixtures = true
self.use_instantiated_fixtures = :no_instances
@@ -299,7 +299,7 @@ class FixturesWithoutInstanceInstantiationTest < Test::Unit::TestCase
end
end
-class TransactionalFixturesTest < Test::Unit::TestCase
+class TransactionalFixturesTest < ActiveSupport::TestCase
self.use_instantiated_fixtures = true
self.use_transactional_fixtures = true
@@ -315,7 +315,7 @@ class TransactionalFixturesTest < Test::Unit::TestCase
end
end
-class MultipleFixturesTest < Test::Unit::TestCase
+class MultipleFixturesTest < ActiveSupport::TestCase
fixtures :topics
fixtures :developers, :accounts
@@ -324,7 +324,7 @@ class MultipleFixturesTest < Test::Unit::TestCase
end
end
-class SetupTest < Test::Unit::TestCase
+class SetupTest < ActiveSupport::TestCase
# fixtures :topics
def setup
@@ -348,7 +348,7 @@ class SetupSubclassTest < SetupTest
end
-class OverlappingFixturesTest < Test::Unit::TestCase
+class OverlappingFixturesTest < ActiveSupport::TestCase
fixtures :topics, :developers
fixtures :developers, :accounts
@@ -357,7 +357,7 @@ class OverlappingFixturesTest < Test::Unit::TestCase
end
end
-class ForeignKeyFixturesTest < Test::Unit::TestCase
+class ForeignKeyFixturesTest < ActiveSupport::TestCase
fixtures :fk_test_has_pk, :fk_test_has_fk
# if foreign keys are implemented and fixtures
@@ -373,7 +373,7 @@ class ForeignKeyFixturesTest < Test::Unit::TestCase
end
end
-class SetTableNameFixturesTest < Test::Unit::TestCase
+class SetTableNameFixturesTest < ActiveSupport::TestCase
set_fixture_class :funny_jokes => 'Joke'
fixtures :funny_jokes
@@ -382,7 +382,7 @@ class SetTableNameFixturesTest < Test::Unit::TestCase
end
end
-class CustomConnectionFixturesTest < Test::Unit::TestCase
+class CustomConnectionFixturesTest < ActiveSupport::TestCase
set_fixture_class :courses => Course
fixtures :courses
@@ -392,7 +392,7 @@ class CustomConnectionFixturesTest < Test::Unit::TestCase
end
end
-class InvalidTableNameFixturesTest < Test::Unit::TestCase
+class InvalidTableNameFixturesTest < ActiveSupport::TestCase
fixtures :funny_jokes
def test_raises_error
@@ -402,7 +402,7 @@ class InvalidTableNameFixturesTest < Test::Unit::TestCase
end
end
-class CheckEscapedYamlFixturesTest < Test::Unit::TestCase
+class CheckEscapedYamlFixturesTest < ActiveSupport::TestCase
set_fixture_class :funny_jokes => 'Joke'
fixtures :funny_jokes
@@ -412,7 +412,7 @@ class CheckEscapedYamlFixturesTest < Test::Unit::TestCase
end
class DevelopersProject; end
-class ManyToManyFixturesWithClassDefined < Test::Unit::TestCase
+class ManyToManyFixturesWithClassDefined < ActiveSupport::TestCase
fixtures :developers_projects
def test_this_should_run_cleanly
@@ -420,22 +420,22 @@ class ManyToManyFixturesWithClassDefined < Test::Unit::TestCase
end
end
-class FixturesBrokenRollbackTest < Test::Unit::TestCase
+class FixturesBrokenRollbackTest < ActiveSupport::TestCase
def blank_setup; end
- alias_method :ar_setup_with_fixtures, :setup_with_fixtures
- alias_method :setup_with_fixtures, :blank_setup
+ alias_method :ar_setup_fixtures, :setup_fixtures
+ alias_method :setup_fixtures, :blank_setup
alias_method :setup, :blank_setup
def blank_teardown; end
- alias_method :ar_teardown_with_fixtures, :teardown_with_fixtures
- alias_method :teardown_with_fixtures, :blank_teardown
+ alias_method :ar_teardown_fixtures, :teardown_fixtures
+ alias_method :teardown_fixtures, :blank_teardown
alias_method :teardown, :blank_teardown
def test_no_rollback_in_teardown_unless_transaction_active
assert_equal 0, Thread.current['open_transactions']
- assert_raise(RuntimeError) { ar_setup_with_fixtures }
+ assert_raise(RuntimeError) { ar_setup_fixtures }
assert_equal 0, Thread.current['open_transactions']
- assert_nothing_raised { ar_teardown_with_fixtures }
+ assert_nothing_raised { ar_teardown_fixtures }
assert_equal 0, Thread.current['open_transactions']
end
@@ -445,7 +445,7 @@ class FixturesBrokenRollbackTest < Test::Unit::TestCase
end
end
-class LoadAllFixturesTest < Test::Unit::TestCase
+class LoadAllFixturesTest < ActiveSupport::TestCase
self.fixture_path= File.join(File.dirname(__FILE__), '/fixtures/all')
fixtures :all
@@ -454,7 +454,7 @@ class LoadAllFixturesTest < Test::Unit::TestCase
end
end
-class FasterFixturesTest < Test::Unit::TestCase
+class FasterFixturesTest < ActiveSupport::TestCase
fixtures :categories, :authors
def load_extra_fixture(name)
@@ -479,7 +479,7 @@ class FasterFixturesTest < Test::Unit::TestCase
end
end
-class FoxyFixturesTest < Test::Unit::TestCase
+class FoxyFixturesTest < ActiveSupport::TestCase
fixtures :parrots, :parrots_pirates, :pirates, :treasures, :mateys, :ships, :computers, :developers
def test_identifies_strings