Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
rrrene committed Jan 30, 2024
1 parent d8cee58 commit bf9541b
Showing 1 changed file with 2 additions and 46 deletions.
48 changes: 2 additions & 46 deletions test/credo/check/warning/wrong_test_file_extension_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -3,50 +3,6 @@ defmodule Credo.Check.Warning.WrongTestFileExtensionTest do

@described_check Credo.Check.Warning.WrongTestFileExtension

Check warning on line 4 in test/credo/check/warning/wrong_test_file_extension_test.exs

View workflow job for this annotation

GitHub Actions / Elixir 1.15.7 OTP 26.1

module attribute @described_check was set but never used

Check warning on line 4 in test/credo/check/warning/wrong_test_file_extension_test.exs

View workflow job for this annotation

GitHub Actions / Elixir 1.13.4 OTP 25.3

module attribute @described_check was set but never used

Check warning on line 4 in test/credo/check/warning/wrong_test_file_extension_test.exs

View workflow job for this annotation

GitHub Actions / Elixir 1.14.5 OTP 24.3

module attribute @described_check was set but never used

Check warning on line 4 in test/credo/check/warning/wrong_test_file_extension_test.exs

View workflow job for this annotation

GitHub Actions / Elixir 1.15.7 OTP 25.3

module attribute @described_check was set but never used

Check warning on line 4 in test/credo/check/warning/wrong_test_file_extension_test.exs

View workflow job for this annotation

GitHub Actions / Elixir 1.11.4 OTP 24.3

module attribute @described_check was set but never used

Check warning on line 4 in test/credo/check/warning/wrong_test_file_extension_test.exs

View workflow job for this annotation

GitHub Actions / Elixir 1.13.4 OTP 24.3

module attribute @described_check was set but never used

Check warning on line 4 in test/credo/check/warning/wrong_test_file_extension_test.exs

View workflow job for this annotation

GitHub Actions / Elixir 1.12.3 OTP 24.3

module attribute @described_check was set but never used

Check warning on line 4 in test/credo/check/warning/wrong_test_file_extension_test.exs

View workflow job for this annotation

GitHub Actions / Elixir 1.13.4 OTP 23.3

module attribute @described_check was set but never used

Check warning on line 4 in test/credo/check/warning/wrong_test_file_extension_test.exs

View workflow job for this annotation

GitHub Actions / Elixir 1.14.5 OTP 23.3

module attribute @described_check was set but never used

Check warning on line 4 in test/credo/check/warning/wrong_test_file_extension_test.exs

View workflow job for this annotation

GitHub Actions / Elixir 1.12.3 OTP 23.3

module attribute @described_check was set but never used

Check warning on line 4 in test/credo/check/warning/wrong_test_file_extension_test.exs

View workflow job for this annotation

GitHub Actions / Elixir 1.11.4 OTP 23.3

module attribute @described_check was set but never used

#
# cases NOT raising issues
#

test "it should NOT report test files that end with _test.exs" do
"""
defmodule Credo.Check.Warning.WrongTestFileExtensionTest do
test "some test" do
assert true
end
end
"""
|> to_source_file("test/credo/check/warning/test_exs_test.exs")
|> run_check(@described_check)
|> refute_issues()
end

test "it should NOT report excluded files" do
"""
defmodule Credo.Check.Warning.WrongTestFileExtensionTest do
test "some test" do
assert true
end
end
"""
|> to_source_file("excluded_pattern/some_test.ex")
|> run_check(@described_check, excluded_paths: ["excluded_pattern/"])
|> refute_issues()
end

#
# cases raising issues
#

test "it should report test files that end with _test.ex" do
"""
defmodule Credo.Check.Warning.WrongTestFileExtensionTest do
test "some test" do
assert true
end
end
"""
|> to_source_file("test/credo/check/warning/test_exs_test.ex")
|> run_check(@described_check)
|> assert_issue()
end
# we can not test this check, because it uses Credo's `:files`/`:included`
# param to only run on misnamed files :(
end

0 comments on commit bf9541b

Please sign in to comment.