Skip to content

Commit 2365ce6

Browse files
committed
Rework --no-specify option test
1 parent 9bf036a commit 2365ce6

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

lib/gradient.ex

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ defmodule Gradient do
6666

6767
defp maybe_specify_forms(forms, opts) do
6868
unless opts[:no_specify] do
69-
IO.puts("Specifying froms...")
70-
7169
forms
7270
|> put_code_path(opts)
7371
|> AstSpecifier.specify()

test/mix/tasks/gradient_test.exs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -103,14 +103,16 @@ defmodule Mix.Tasks.GradientTest do
103103
assert not String.contains?(output, ex_spec_error_msg)
104104
end
105105

106+
@tag if(System.version() >= "1.13", do: :skip, else: :ok)
106107
test "--no-specify option" do
107-
info = "Specifying froms..."
108-
109108
output = run_task(@type_path, ["--no-compile", "--", @s_wrong_ret_beam])
110-
assert String.contains?(output, info)
109+
assert String.contains?(output, "on line 3")
110+
assert String.contains?(output, "on line 6")
111111

112112
output = run_task(@type_path, ["--no-compile", "--no-specify", "--", @s_wrong_ret_beam])
113-
assert not String.contains?(output, info)
113+
assert String.contains?(output, "on line 0")
114+
assert not String.contains?(output, "on line 3")
115+
assert not String.contains?(output, "on line 6")
114116
end
115117

116118
test "--stop-on-first-error option" do
@@ -156,7 +158,10 @@ defmodule Mix.Tasks.GradientTest do
156158

157159
test "--code-path option" do
158160
ex_file = "wrong_ret.ex"
159-
output = run_task(@type_path, ["--no-compile", "--code-path", ex_file, "--", @s_wrong_ret_beam])
161+
162+
output =
163+
run_task(@type_path, ["--no-compile", "--code-path", ex_file, "--", @s_wrong_ret_beam])
164+
160165
assert not String.contains?(output, @s_wrong_ret_ex)
161166
assert String.contains?(output, ex_file)
162167
end

0 commit comments

Comments
 (0)