Skip to content

Commit 389161e

Browse files
committed
fix(test): propagate setup and teardown
1 parent 4c6c3f9 commit 389161e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

test/cases/adapter_test.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class AdapterForeignKeyTest < ActiveRecord::TestCase
7070
fixtures :fk_test_has_pk
7171

7272
def before_setup
73+
super
7374
conn = ActiveRecord::Base.lease_connection
7475

7576
conn.drop_table :fk_test_has_fk, if_exists: true
@@ -87,6 +88,7 @@ def before_setup
8788
end
8889

8990
def setup
91+
super
9092
@connection = ActiveRecord::Base.lease_connection
9193
end
9294

test/cases/fixtures_test.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,7 @@ class FixturesResetPkSequenceTest < ActiveRecord::TestCase
288288
# We'll do this in a before_setup so we get ahead of
289289
# ActiveRecord::TestFixtures#before_setup.
290290
def before_setup
291+
super
291292
Account.lease_connection.drop_table :accounts, if_exists: true
292293
Account.lease_connection.exec_query("CREATE SEQUENCE IF NOT EXISTS accounts_id_seq")
293294
Account.lease_connection.exec_query("
@@ -336,12 +337,14 @@ def before_setup
336337
end
337338

338339
def setup
340+
super
339341
@instances = [Account.new(credit_limit: 50), Company.new(name: "RoR Consulting"), Course.new(name: "Test")]
340342
ActiveRecord::FixtureSet.reset_cache # make sure tables get reinitialized
341343
end
342344

343345
# Drop the primary key sequences and bring back the original tables.
344346
def teardown
347+
super
345348
Account.lease_connection.drop_table :accounts, if_exists: true
346349
Account.lease_connection.exec_query("DROP SEQUENCE IF EXISTS accounts_id_seq")
347350
Account.lease_connection.create_table :accounts, force: true do |t|

0 commit comments

Comments
 (0)