Skip to content

Commit

Permalink
cleanup test
Browse files Browse the repository at this point in the history
  • Loading branch information
Greg Rychlewski authored and Greg Rychlewski committed Jul 21, 2023
1 parent 45887b2 commit d9fefad
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions integration_test/myxql/storage_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,12 @@ defmodule Ecto.Integration.StorageTest do
end

test "raises when attempting to dump multiple prefixes" do
create_database()
prefix = params()[:database]
config = Keyword.put(TestRepo.config(), :dump_prefixes, ["ecto_test", prefix])
config = Keyword.put(TestRepo.config(), :dump_prefixes, ["ecto_test", "another_db"])
msg = "cannot dump multiple prefixes with MySQL. Please run the command separately for each prefix."

assert_raise ArgumentError, msg, fn ->
Ecto.Adapters.MyXQL.structure_dump(tmp_path(), config)
end
after
drop_database()
end

test "dumps structure and schema_migration records only from queried prefix" do
Expand All @@ -184,6 +180,8 @@ defmodule Ecto.Integration.StorageTest do
refute contents =~ "USE `#{prefix}`"
assert contents =~ "Database: #{prefix}"
assert contents =~ "INSERT INTO `schema_migrations` (version) VALUES (#{version})"
after
drop_database()
end

defp strip_timestamp(dump) do
Expand Down

0 comments on commit d9fefad

Please sign in to comment.