Skip to content

Commit 83216bb

Browse files
committed
fixup! refactor: cleanup old code
1 parent 681207a commit 83216bb

File tree

2 files changed

+1
-44
lines changed

2 files changed

+1
-44
lines changed

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ group :development, :test do
5252
gem "msgpack", ">= 1.7.0"
5353
gem "mutex_m", "~> 0.2.0"
5454

55+
gem "tracer"
5556
gem "rake"
5657
gem "debug"
5758
gem "minitest-bisect", github: "BuonOmo/minitest-bisect", branch: "main"

test/cases/adapter_test.rb

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ def test_remove_index_when_name_and_wrong_column_name_specified_positional_argum
6767
class AdapterTestWithoutTransaction < ActiveRecord::TestCase
6868
self.use_transactional_tests = false
6969

70-
fixtures :posts, :authors, :author_addresses
71-
7270
class Widget < ActiveRecord::Base
7371
self.primary_key = "widgetid"
7472
end
@@ -79,7 +77,6 @@ def setup
7977

8078
teardown do
8179
@connection.drop_table :widgets, if_exists: true
82-
@connection.exec_query("DROP SEQUENCE IF EXISTS widget_seq")
8380
@connection.exec_query("DROP SEQUENCE IF EXISTS widgets_seq")
8481
end
8582

@@ -97,46 +94,5 @@ def test_reset_empty_table_with_custom_pk_sequence
9794
")
9895
assert_equal 1, Widget.create(name: "weather").id
9996
end
100-
101-
def test_truncate_tables
102-
assert_operator Post.count, :>, 0
103-
assert_operator Author.count, :>, 0
104-
assert_operator AuthorAddress.count, :>, 0
105-
106-
@connection.truncate_tables("author_addresses", "authors", "posts")
107-
108-
assert_equal 0, Post.count
109-
assert_equal 0, Author.count
110-
assert_equal 0, AuthorAddress.count
111-
ensure
112-
reset_fixtures("author_addresses", "authors", "posts")
113-
end
114-
115-
def test_truncate_tables_with_query_cache
116-
@connection.enable_query_cache!
117-
118-
assert_operator Post.count, :>, 0
119-
assert_operator Author.count, :>, 0
120-
assert_operator AuthorAddress.count, :>, 0
121-
122-
@connection.truncate_tables("author_addresses", "authors", "posts")
123-
124-
assert_equal 0, Post.count
125-
assert_equal 0, Author.count
126-
assert_equal 0, AuthorAddress.count
127-
ensure
128-
reset_fixtures("author_addresses", "authors", "posts")
129-
@connection.disable_query_cache!
130-
end
131-
132-
private
133-
134-
def reset_fixtures(*fixture_names)
135-
ActiveRecord::FixtureSet.reset_cache
136-
137-
fixture_names.each do |fixture_name|
138-
ActiveRecord::FixtureSet.create_fixtures(FIXTURES_ROOT, fixture_name)
139-
end
140-
end
14197
end
14298
end

0 commit comments

Comments
 (0)