mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Update tests
This commit is contained in:
parent
7ac351aaca
commit
b91dd419e2
1 changed files with 10 additions and 10 deletions
|
@ -361,7 +361,7 @@ if current_adapter?(:PostgreSQLAdapter)
|
|||
assert_called_with(
|
||||
Kernel,
|
||||
:system,
|
||||
["pg_dump", "-s", "-x", "-O", "-f", @filename, "my-app-db"],
|
||||
["pg_dump", "--schema-only", "--no-privileges", "--no-owner", "--file", @filename, "my-app-db"],
|
||||
returns: true
|
||||
) do
|
||||
ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, @filename)
|
||||
|
@ -378,7 +378,7 @@ if current_adapter?(:PostgreSQLAdapter)
|
|||
end
|
||||
|
||||
def test_structure_dump_with_extra_flags
|
||||
expected_command = ["pg_dump", "-s", "-x", "-O", "-f", @filename, "--noop", "my-app-db"]
|
||||
expected_command = ["pg_dump", "--schema-only", "--no-privileges", "--no-owner", "--file", @filename, "--noop", "my-app-db"]
|
||||
|
||||
assert_called_with(Kernel, :system, expected_command, returns: true) do
|
||||
with_structure_dump_flags(["--noop"]) do
|
||||
|
@ -396,7 +396,7 @@ if current_adapter?(:PostgreSQLAdapter)
|
|||
assert_called_with(
|
||||
Kernel,
|
||||
:system,
|
||||
["pg_dump", "-s", "-x", "-O", "-f", @filename, "-T", "foo", "-T", "bar", "my-app-db"],
|
||||
["pg_dump", "--schema-only", "--no-privileges", "--no-owner", "--file", @filename, "-T", "foo", "-T", "bar", "my-app-db"],
|
||||
returns: true
|
||||
) do
|
||||
ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, @filename)
|
||||
|
@ -410,7 +410,7 @@ if current_adapter?(:PostgreSQLAdapter)
|
|||
assert_called_with(
|
||||
Kernel,
|
||||
:system,
|
||||
["pg_dump", "-s", "-x", "-O", "-f", @filename, "--schema=foo", "--schema=bar", "my-app-db"],
|
||||
["pg_dump", "--schema-only", "--no-privileges", "--no-owner", "--file", @filename, "--schema=foo", "--schema=bar", "my-app-db"],
|
||||
returns: true
|
||||
) do
|
||||
ActiveRecord::Tasks::DatabaseTasks.structure_dump(@configuration, @filename)
|
||||
|
@ -423,7 +423,7 @@ if current_adapter?(:PostgreSQLAdapter)
|
|||
assert_called_with(
|
||||
Kernel,
|
||||
:system,
|
||||
["pg_dump", "-s", "-x", "-O", "-f", @filename, "my-app-db"],
|
||||
["pg_dump", "--schema-only", "--no-privileges", "--no-owner", "--file", @filename, "my-app-db"],
|
||||
returns: true
|
||||
) do
|
||||
with_dump_schemas(:all) do
|
||||
|
@ -436,7 +436,7 @@ if current_adapter?(:PostgreSQLAdapter)
|
|||
assert_called_with(
|
||||
Kernel,
|
||||
:system,
|
||||
["pg_dump", "-s", "-x", "-O", "-f", @filename, "--schema=foo", "--schema=bar", "my-app-db"],
|
||||
["pg_dump", "--schema-only", "--no-privileges", "--no-owner", "--file", @filename, "--schema=foo", "--schema=bar", "my-app-db"],
|
||||
returns: true
|
||||
) do
|
||||
with_dump_schemas("foo,bar") do
|
||||
|
@ -450,7 +450,7 @@ if current_adapter?(:PostgreSQLAdapter)
|
|||
assert_called_with(
|
||||
Kernel,
|
||||
:system,
|
||||
["pg_dump", "-s", "-x", "-O", "-f", filename, "my-app-db"],
|
||||
["pg_dump", "--schema-only", "--no-privileges", "--no-owner", "--file", filename, "my-app-db"],
|
||||
returns: nil
|
||||
) do
|
||||
e = assert_raise(RuntimeError) do
|
||||
|
@ -491,7 +491,7 @@ if current_adapter?(:PostgreSQLAdapter)
|
|||
assert_called_with(
|
||||
Kernel,
|
||||
:system,
|
||||
["psql", "-v", "ON_ERROR_STOP=1", "-q", "-X", "-f", filename, @configuration["database"]],
|
||||
["psql", "--set", "ON_ERROR_STOP=1", "--quiet", "--no-psqlrc", "--file", filename, @configuration["database"]],
|
||||
returns: true
|
||||
) do
|
||||
ActiveRecord::Tasks::DatabaseTasks.structure_load(@configuration, filename)
|
||||
|
@ -500,7 +500,7 @@ if current_adapter?(:PostgreSQLAdapter)
|
|||
|
||||
def test_structure_load_with_extra_flags
|
||||
filename = "awesome-file.sql"
|
||||
expected_command = ["psql", "-v", "ON_ERROR_STOP=1", "-q", "-X", "-f", filename, "--noop", @configuration["database"]]
|
||||
expected_command = ["psql", "--set", "ON_ERROR_STOP=1", "--quiet", "--no-psqlrc", "--file", filename, "--noop", @configuration["database"]]
|
||||
|
||||
assert_called_with(Kernel, :system, expected_command, returns: true) do
|
||||
with_structure_load_flags(["--noop"]) do
|
||||
|
@ -514,7 +514,7 @@ if current_adapter?(:PostgreSQLAdapter)
|
|||
assert_called_with(
|
||||
Kernel,
|
||||
:system,
|
||||
["psql", "-v", "ON_ERROR_STOP=1", "-q", "-X", "-f", filename, @configuration["database"]],
|
||||
["psql", "--set", "ON_ERROR_STOP=1", "--quiet", "--no-psqlrc", "--file", filename, @configuration["database"]],
|
||||
returns: true
|
||||
) do
|
||||
ActiveRecord::Tasks::DatabaseTasks.structure_load(@configuration, filename)
|
||||
|
|
Loading…
Reference in a new issue