Skip to content

Commit

Permalink
Added test for unsupported adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Nov 2, 2024
1 parent 67aefe1 commit 23f346d
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ gem "activerecord", "~> 7.2.0"
gem "pg"
gem "mysql2"
gem "trilogy"
gem "sqlite3"
1 change: 1 addition & 0 deletions gemfiles/activerecord61.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ gem "activerecord", "~> 6.1.0"
gem "pg", "< 1.5"
gem "mysql2"
gem "activerecord-trilogy-adapter"
gem "sqlite3", "< 2"
1 change: 1 addition & 0 deletions gemfiles/activerecord70.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ gem "activerecord", "~> 7.0.0"
gem "pg"
gem "mysql2"
gem "activerecord-trilogy-adapter"
gem "sqlite3", "< 2"
1 change: 1 addition & 0 deletions gemfiles/activerecord71.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ gem "activerecord", "~> 7.1.0"
gem "pg"
gem "mysql2"
gem "trilogy"
gem "sqlite3", "< 2"
1 change: 1 addition & 0 deletions gemfiles/activerecord80.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ gem "activerecord", "~> 8.0.0.beta1"
gem "pg"
gem "mysql2"
gem "trilogy"
gem "sqlite3"
11 changes: 11 additions & 0 deletions test/misc_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,15 @@ def test_target_version_outside_developer_env
end
end
end

def test_unsupported_adapter
previous_db_config = ActiveRecord::Base.connection_db_config.configuration_hash
ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
schema_migration.create_table
assert_output nil, /Unsupported adapter/ do
assert_unsafe CreateTableForce
end
ensure
ActiveRecord::Base.establish_connection(previous_db_config) if previous_db_config
end
end

0 comments on commit 23f346d

Please sign in to comment.