11defmodule Mix.Tasks.Hex.PackageTest do
22 use HexTest.IntegrationCase
33
4+ @ git_diff_command "git diff --no-index --no-color --no-ext-diff __PATH1__ __PATH2__"
5+
46 defp in_diff_fixture ( fun ) do
57 in_fixture ( "diff" , fn ->
68 Mix.Project . push ( ReleaseDeps.MixProject )
@@ -107,7 +109,7 @@ defmodule Mix.Tasks.Hex.PackageTest do
107109
108110 test "diff: success with version number" do
109111 in_diff_fixture ( fn ->
110- Hex.State . put ( :diff_command , "git diff --no-index --no-color __PATH1__ __PATH2__" )
112+ Hex.State . put ( :diff_command , @ git_diff_command )
111113
112114 assert catch_throw ( Mix.Tasks.Hex.Package . run ( [ "diff" , "ex_doc" , "0.1.0" ] ) ) ==
113115 { :exit_code , 1 }
@@ -152,7 +154,7 @@ defmodule Mix.Tasks.Hex.PackageTest do
152154
153155 test "diff: success with version range" do
154156 in_diff_fixture ( fn ->
155- Hex.State . put ( :diff_command , "git diff --no-index --no-color __PATH1__ __PATH2__" )
157+ Hex.State . put ( :diff_command , @ git_diff_command )
156158
157159 assert catch_throw ( Mix.Tasks.Hex.Package . run ( [ "diff" , "ex_doc" , "0.0.1..0.1.0" ] ) ) ==
158160 { :exit_code , 1 }
@@ -167,7 +169,7 @@ defmodule Mix.Tasks.Hex.PackageTest do
167169
168170 test "diff: success (variant args)" do
169171 in_diff_fixture ( fn ->
170- Hex.State . put ( :diff_command , "git diff --no-index --no-color __PATH1__ __PATH2__" )
172+ Hex.State . put ( :diff_command , @ git_diff_command )
171173
172174 assert catch_throw ( Mix.Tasks.Hex.Package . run ( [ "diff" , "ex_doc" , "0.0.1" , "0.1.0" ] ) ) ==
173175 { :exit_code , 1 }
0 commit comments