@@ -6,7 +6,6 @@ defmodule Ecto.MigratorTest do
66 import ExUnit.CaptureLog
77
88 alias EctoSQL.TestRepo
9- alias Ecto.Migration.SchemaMigration
109
1110 defmodule Migration do
1211 use Ecto.Migration
@@ -259,14 +258,6 @@ defmodule Ecto.MigratorTest do
259258 end )
260259 end
261260
262- test "custom schema migrations table is right" do
263- assert { _repo , "schema_migrations" } =
264- SchemaMigration . get_repo_and_source ( TestRepo , TestRepo . config ( ) )
265-
266- assert { _repo , "my_schema_migrations" } =
267- SchemaMigration . get_repo_and_source ( MigrationSourceRepo , MigrationSourceRepo . config ( ) )
268- end
269-
270261 test "migrator prefix" do
271262 capture_log ( fn ->
272263 :ok = up ( TestRepo , 10 , ChangeMigration , prefix: :custom )
@@ -403,6 +394,17 @@ defmodule Ecto.MigratorTest do
403394 refute_received { :lock_for_migrations , _ , _ , _ }
404395 end
405396
397+ test "on migration_source" do
398+ assert up ( TestRepo , 9 , Migration , log: false , migration_source: "custom" ) == :ok
399+ assert_receive { :lock_for_migrations , _ , _ , opts }
400+ assert opts [ :migration_source ] == "custom"
401+ end
402+
403+ test "on migration_lock" do
404+ assert up ( TestRepo , 9 , Migration , log: false , migration_lock: false ) == :ok
405+ refute_receive { :lock_for_migrations , _ , _ , _ }
406+ end
407+
406408 test "on run" do
407409 in_tmp fn path ->
408410 create_migration "13_sample.exs"
@@ -435,8 +437,9 @@ defmodule Ecto.MigratorTest do
435437 expected_result = [ { :up , 15 , "sample" } ]
436438 assert migrations ( TestRepo , path , skip_table_creation: true ) == expected_result
437439
438- assert_receive { :lock_for_migrations , _ , _ , [ skip_table_creation: true ] }
440+ assert_receive { :lock_for_migrations , _ , _ , opts }
439441 refute_received { :lock_for_migrations , _ , _ , _ }
442+ assert opts [ :skip_table_creation ] == true
440443
441444 assert match? ( nil , last_command ( ) )
442445 end
@@ -449,7 +452,8 @@ defmodule Ecto.MigratorTest do
449452 expected_result = [ { :up , 15 , "sample" } ]
450453 assert migrations ( TestRepo , path ) == expected_result
451454
452- assert_receive { :lock_for_migrations , _ , _ , [ ] }
455+ assert_receive { :lock_for_migrations , _ , _ , opts }
456+ assert opts [ :migration_source ] == "schema_migrations"
453457 refute_received { :lock_for_migrations , _ , _ , _ }
454458
455459 assert match? ( { :create_if_not_exists , % _ { name: :schema_migrations } , _ } , last_command ( ) )
0 commit comments