Skip to content

Commit

Permalink
Fixed CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Oct 30, 2022
1 parent f589103 commit 2b3262a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 3 additions & 1 deletion test/add_index_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,10 @@ def test_auto_analyze
def test_extra_arguments
if postgresql?
assert_unsafe AddIndexExtraArguments
else
elsif ActiveRecord::VERSION::STRING.to_f >= 6.1
assert_argument_error AddIndexExtraArguments
else
assert_type_error AddIndexExtraArguments
end
end

Expand Down
6 changes: 5 additions & 1 deletion test/safe_by_default_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ def test_add_index
end

def test_add_index_extra_arguments
assert_argument_error AddIndexExtraArguments
if postgresql? || ActiveRecord::VERSION::STRING.to_f >= 6.1
assert_argument_error AddIndexExtraArguments
else
assert_type_error AddIndexExtraArguments
end
end

def test_add_index_corruption
Expand Down
6 changes: 6 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,12 @@ def assert_argument_error(migration)
end
end

def assert_type_error(migration)
assert_raises(TypeError) do
migrate(migration)
end
end

def with_target_version(version)
StrongMigrations.target_version = version
yield
Expand Down

0 comments on commit 2b3262a

Please sign in to comment.