Skip to content

Commit 2bf5892

Browse files
committed
Remove conditional
1 parent 4e97eab commit 2bf5892

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

spec/migration_lock_timeout/migration_spec.rb

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,16 @@
88
ACTIVE_RECORD_MIGRATION_CLASS = ActiveRecord::Migration[ActiveRecord::VERSION::STRING.to_f]
99

1010
def expect_create_table
11-
if ActiveRecord.gem_version >= '7.1'
12-
expect(ActiveRecord::Base.connection).to receive(:execute).
13-
with('BEGIN').
14-
and_call_original
15-
expect(ActiveRecord::Base.connection).to receive(:execute).
16-
with(/CREATE TABLE/).
17-
and_call_original
18-
else
19-
expect(ActiveRecord::Base.connection).to receive(:execute).
20-
with('BEGIN', 'TRANSACTION').
21-
and_call_original
22-
expect(ActiveRecord::Base.connection).to receive(:execute).
23-
with(/CREATE TABLE/).
24-
and_call_original
25-
end
11+
expect(ActiveRecord::Base.connection).to receive(:execute).
12+
with('BEGIN', 'TRANSACTION').
13+
and_call_original
14+
expect(ActiveRecord::Base.connection).to receive(:execute).
15+
with(/CREATE TABLE/).
16+
and_call_original
2617
end
2718

2819
RSpec.describe ActiveRecord::Migration do
29-
before { ActiveRecord::Base.logger = Logger.new(STDOUT) }
20+
3021
describe '#migrate' do
3122

3223
before(:each) do

spec/migration_lock_timeout/spec_helper.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
require 'database_cleaner'
22

33
RSpec.configure do |config|
4+
5+
ActiveRecord::Base.logger = Logger.new(STDOUT)
46
config.before(:suite) do
57
ActiveRecord::Base.establish_connection(
68
adapter: "postgresql",

0 commit comments

Comments
 (0)