File tree 1 file changed +16
-11
lines changed
spec/migration_lock_timeout
1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change 5
5
require 'strong_migrations' if Gem . loaded_specs . has_key? 'strong_migrations'
6
6
require_relative '../../lib/migration-lock-timeout'
7
7
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 ]
13
9
14
10
def expect_create_table
15
- expect ( ActiveRecord ::Base . connection ) . to receive ( :execute ) .
16
- with ( 'BEGIN' , 'TRANSACTION' ) .
11
+ if ActiveRecord . gem_version >= '7.1'
12
+ expect ( ActiveRecord ::Base . connection ) . to receive ( :execute ) .
13
+ with ( /ROLLBACK/ ) .
14
+ and_call_original
15
+ expect ( ActiveRecord ::Base . connection ) . to receive ( :execute ) .
16
+ with ( /CREATE TABLE/ ) .
17
17
and_call_original
18
- expect ( ActiveRecord ::Base . connection ) . to receive ( :execute ) .
19
- with ( /CREATE TABLE/ ) .
20
- 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
21
26
end
22
27
23
28
RSpec . describe ActiveRecord ::Migration do
24
-
29
+ before { ActiveRecord :: Base . logger = Logger . new ( STDOUT ) }
25
30
describe '#migrate' do
26
31
27
32
before ( :each ) do
You can’t perform that action at this time.
0 commit comments