-
Notifications
You must be signed in to change notification settings - Fork 189
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support :warn_if_outdated in deps (#1058)
- Loading branch information
1 parent
96c8f54
commit f963a8f
Showing
5 changed files
with
89 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
defmodule Hex.RemoteConvergetTest do | ||
use HexTest.IntegrationCase | ||
|
||
defmodule OutdatedDepsBefore.MixProject do | ||
def project do | ||
[ | ||
app: :outdated_deps, | ||
version: "0.1.0", | ||
deps: [ | ||
{:postgrex, "0.2.1", warn_if_outdated: true}, | ||
{:ecto, "3.3.1", warn_if_outdated: true}, | ||
{:ecto_sql, "3.3.2", warn_if_outdated: true} | ||
] | ||
] | ||
end | ||
end | ||
|
||
defmodule OutdatedDepsAfter.MixProject do | ||
def project do | ||
[ | ||
app: :outdated_deps, | ||
version: "0.1.0", | ||
deps: [ | ||
{:postgrex, ">= 0.0.0", warn_if_outdated: true}, | ||
{:ecto, ">= 0.0.0", warn_if_outdated: true}, | ||
{:ecto_sql, ">= 0.0.0", warn_if_outdated: true} | ||
] | ||
] | ||
end | ||
end | ||
|
||
test "deps with warn_if_outdated: true" do | ||
in_tmp(fn -> | ||
Mix.Project.push(OutdatedDepsBefore.MixProject) | ||
:ok = Mix.Tasks.Deps.Get.run([]) | ||
|
||
Mix.Project.pop() | ||
Mix.Project.push(OutdatedDepsAfter.MixProject) | ||
|
||
output = | ||
ExUnit.CaptureIO.capture_io(:stderr, fn -> | ||
:ok = Mix.Tasks.Deps.Get.run([]) | ||
end) | ||
|
||
assert output =~ "ecto 3.3.2 is available" | ||
assert output =~ "ecto_sql 3.3.3 is available" | ||
refute output =~ "postgrex" | ||
end) | ||
end | ||
end |