@@ -240,9 +240,9 @@ defmodule Ecto.MigratorTest do
240240 lines = String . split ( output , "\n " )
241241 assert Enum . at ( lines , 1 ) =~ "== Running #{ num } #{ inspect ( module ) } .change/0"
242242 assert Enum . at ( lines , 3 ) =~ ~s[ execute "select 'This is a first part of ecto.#{ name } ';"]
243- assert Enum . at ( lines , 5 ) =~ "select 'In the middle of ecto.#{ name } ';"
244- assert Enum . at ( lines , 7 ) =~ ~s[ execute "select 'This is a second part of ecto.#{ name } ';"]
245- assert Enum . at ( lines , 9 ) =~ ~r" Migrated #{ num } in \d .\d s"
243+ assert Enum . at ( lines , 7 ) =~ "select 'In the middle of ecto.#{ name } ';"
244+ assert Enum . at ( lines , 9 ) =~ ~s[ execute "select 'This is a second part of ecto.#{ name } ';"]
245+ assert Enum . at ( lines , 13 ) =~ ~r" Migrated #{ num } in \d .\d s"
246246 end
247247 end
248248
@@ -333,6 +333,30 @@ defmodule Ecto.MigratorTest do
333333 assert output =~ ~r" == Migrated 12 in \d .\d s"
334334 end
335335
336+ test "logs ddl notices" do
337+ output = capture_log fn ->
338+ :ok = up ( TestRepo , 10 , ChangeMigration )
339+ end
340+ assert output =~ "execute ddl"
341+
342+ output = capture_log fn ->
343+ :ok = down ( TestRepo , 10 , ChangeMigration )
344+ end
345+ assert output =~ "execute ddl"
346+ end
347+
348+ test "silences ddl notices when log is set to false" do
349+ output = capture_log fn ->
350+ :ok = up ( TestRepo , 10 , ChangeMigration , log: false )
351+ end
352+ refute output =~ "execute ddl"
353+
354+ output = capture_log fn ->
355+ :ok = down ( TestRepo , 10 , ChangeMigration , log: false )
356+ end
357+ refute output =~ "execute ddl"
358+ end
359+
336360 test "up raises error in strict mode" do
337361 assert_raise Ecto.MigrationError , fn ->
338362 up ( TestRepo , 0 , Migration , log: false , strict_version_order: true )
0 commit comments