Skip to content

Commit

Permalink
Make stacktrace test conditional on Elixir version (#603)
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-rychlewski authored Apr 28, 2024
1 parent c994b85 commit a1ee3a2
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions test/ecto/migrator_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -406,17 +406,20 @@ defmodule Ecto.MigratorTest do
end
end

test "warns for .ex files that look like migrations" do
in_tmp(fn path ->
output =
capture_io(:stderr, fn ->
create_migration("123_looks_like_migration.ex")
assert run(TestRepo, path, :up, all: true, log: false) == []
end)
# TODO: Remove when we require Elixir 1.14
if Version.match?(System.version(), ">= 1.14.0") do
test "warns for .ex files that look like migrations" do
in_tmp(fn path ->
output =
capture_io(:stderr, fn ->
create_migration("123_looks_like_migration.ex")
assert run(TestRepo, path, :up, all: true, log: false) == []
end)

assert output =~ "file looks like a migration but ends in .ex"
assert output =~ "123_looks_like_migration.ex"
end)
assert output =~ "file looks like a migration but ends in .ex"
assert output =~ "123_looks_like_migration.ex"
end)
end
end

describe "lock for migrations" do
Expand Down

0 comments on commit a1ee3a2

Please sign in to comment.