Skip to content

Commit 10e0289

Browse files
committed
Simplify spec for only supported versions of activerecord
1 parent ef62782 commit 10e0289

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

spec/migration_lock_timeout/migration_spec.rb

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,10 @@
55
require 'strong_migrations' if Gem.loaded_specs.has_key? 'strong_migrations'
66
require_relative '../../lib/migration-lock-timeout'
77

8-
ACTIVE_RECORD_MIGRATION_CLASS = if ActiveRecord.gem_version < '5.0'
9-
ActiveRecord::Migration
10-
else
11-
ActiveRecord::Migration[ActiveRecord::VERSION::STRING.to_f]
12-
end
8+
ACTIVE_RECORD_MIGRATION_CLASS = ActiveRecord::Migration[ActiveRecord::VERSION::STRING.to_f]
139

1410
def expect_create_table
15-
if ActiveRecord.gem_version < '6.0'
16-
expect(ActiveRecord::Base.connection).to receive(:execute).
17-
with(/CREATE TABLE/).
18-
and_call_original
19-
elsif ActiveRecord.gem_version < '6.1.0'
20-
expect(ActiveRecord::Base.connection).to receive(:execute).
21-
with(/BEGIN/).
22-
and_call_original
11+
if ActiveRecord.gem_version >= '7.1'
2312
expect(ActiveRecord::Base.connection).to receive(:execute).
2413
with(/CREATE TABLE/).
2514
and_call_original

0 commit comments

Comments
 (0)