-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #269 from dgvncsz0f/master
chore: PathReader.base_path config
- Loading branch information
Showing
3 changed files
with
16 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,20 @@ | ||
defmodule ExCoveralls.PathReaderTest do | ||
use ExUnit.Case | ||
use ExUnit.Case, async: false | ||
alias ExCoveralls.PathReader | ||
|
||
test "gets project base path" do | ||
assert(PathReader.base_path == File.cwd!) | ||
assert(PathReader.base_path() == File.cwd!()) | ||
end | ||
|
||
test "expand path" do | ||
assert(PathReader.expand_path("test") == File.cwd! <> "/test") | ||
assert(PathReader.expand_path("test") == File.cwd!() <> "/test") | ||
end | ||
|
||
test "use the application config when it is available" do | ||
Application.put_env(:excoveralls, :base_path, "/base/path") | ||
assert("/base/path" != File.cwd!()) | ||
assert(PathReader.base_path() == "/base/path") | ||
after | ||
Application.delete_env(:excoveralls, :base_path) | ||
end | ||
end |