-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improvement: add proper_test_location/1 (#17)
- Loading branch information
1 parent
06ede40
commit 1271a75
Showing
2 changed files
with
45 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
defmodule Igniter.Code.ModuleTest do | ||
use ExUnit.Case | ||
|
||
test "proper_location/1 returns idiomatic path" do | ||
assert "lib/my_app/hello.ex" = Igniter.Code.Module.proper_location(MyApp.Hello) | ||
end | ||
|
||
describe "proper_test_location/1" do | ||
test "returns a path with _test appended if the module name doesn't end with Test" do | ||
assert "test/my_app/hello_test.exs" = Igniter.Code.Module.proper_test_location(MyApp.Hello) | ||
end | ||
|
||
test "returns a path without appending _test if the module name already ends with Test" do | ||
assert "test/my_app/hello_test.exs" = | ||
Igniter.Code.Module.proper_test_location(MyApp.HelloTest) | ||
end | ||
end | ||
end |