Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor #15

Merged
merged 5 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
checkpoint
  • Loading branch information
dogweather committed Dec 4, 2023
commit d5aaf0229b2c1275e44f7486aadcbcfaa1358be4
5 changes: 5 additions & 0 deletions lib/news/test.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
defmodule News.Test do
def fixture(name) do
Path.join("test/fixtures", name)
end
end
10 changes: 1 addition & 9 deletions test/news_util_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ defmodule NewsUtilTest do
use ExUnit.Case
doctest NewsUtil

def fixture(name) do
Path.join("test/fixtures", name)
end

def find_citations_in_fixture(name) do
find_citations_in_file(fixture(name))
end

@test_cases [
%{
file: "qandasec5.asp",
Expand Down Expand Up @@ -74,7 +66,7 @@ defmodule NewsUtilTest do

Enum.each(@test_cases, fn %{file: f, cites: c} ->
test "finds the cites in #{f}" do
assert find_citations_in_fixture(unquote f) == unquote(c)
assert find_citations_in_file(News.Test.fixture(unquote(f))) == unquote(c)
end
end)
end