Skip to content

Commit

Permalink
fix tests with cause by file changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
rkotze committed Jan 31, 2016
1 parent 72d234d commit 0a98601
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/tasks/path_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ defmodule EyeDrops.Tasks.PathTest do
alias EyeDrops.Tasks.Path

test "Path exists" do
result = Path.exists?("lib/eye_drops.ex")
result = Path.exists?("lib/mix/tasks/eye_drops.ex")
assert result == true
end

Expand All @@ -13,17 +13,17 @@ defmodule EyeDrops.Tasks.PathTest do
end

test "Changed file matches list of paths from task" do
result = Path.spotted?("/some/random/lib/eye_drops.ex", ["lib/eye_drops.ex", "lib/other.ex"])
result = Path.spotted?("random/lib/mix/tasks/eye_drops.ex", ["lib/mix/tasks/eye_drops.ex", "lib/other.ex"])
assert result == true
end

test "Changed file matches list of wildcard paths from task" do
result = Path.spotted?("/some/random/lib/eye_drops.ex", ["lib/*", "test/other.ex"])
result = Path.spotted?("lib/mix/tasks/eye_drops.ex", ["lib/mix/tasks/*", "test/other.ex"])
assert result == true
end

test "Changed file matches wildcard path from task" do
result = Path.spotted?("/some/random/lib/eye_drops.ex", "lib/*")
result = Path.spotted?("lib/mix/tasks/eye_drops.ex", "lib/*")
assert result == true
end

Expand Down
2 changes: 1 addition & 1 deletion lib/tasks/tasks_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ defmodule EyeDrops.TasksTest do
# mock get config with empty tasks

test "Get tasks to run if expected file has changed", %{:tasks => tasks} do
tasks = EyeDrops.Tasks.to_run(tasks, "some/path/lib/eye_drops.ex")
tasks = EyeDrops.Tasks.to_run(tasks, "some/path/lib/mix/tasks/eye_drops.ex")
assert Enum.at(tasks,0).id == :demo1
end

Expand Down

0 comments on commit 0a98601

Please sign in to comment.