diff --git a/test/refactor/alias/expand_aliases_test.exs b/test/refactor/alias/expand_aliases_test.exs index 13ca538..98510f4 100644 --- a/test/refactor/alias/expand_aliases_test.exs +++ b/test/refactor/alias/expand_aliases_test.exs @@ -117,7 +117,7 @@ defmodule Refactorex.Refactor.Alias.ExpandAliasesTest do end test "ignores outside module" do - assert_not_refactored( + assert_ignored( ExpandAliases, """ # v @@ -128,7 +128,7 @@ defmodule Refactorex.Refactor.Alias.ExpandAliasesTest do end test "ignores outside alias" do - assert_not_refactored( + assert_ignored( ExpandAliases, """ defmodule Foo do diff --git a/test/refactor/alias/extract_alias_test.exs b/test/refactor/alias/extract_alias_test.exs index 5263b2d..1f859d2 100644 --- a/test/refactor/alias/extract_alias_test.exs +++ b/test/refactor/alias/extract_alias_test.exs @@ -114,7 +114,7 @@ defmodule Refactorex.Refactor.Alias.ExtractAliasTest do end test "ignores alias declaration" do - assert_not_refactored( + assert_ignored( ExtractAlias, """ defmodule Foo do @@ -127,7 +127,7 @@ defmodule Refactorex.Refactor.Alias.ExtractAliasTest do end test "ignores single alias" do - assert_not_refactored( + assert_ignored( ExtractAlias, """ defmodule Foo do @@ -142,7 +142,7 @@ defmodule Refactorex.Refactor.Alias.ExtractAliasTest do end test "ignores if there would be a name conflict" do - assert_not_refactored( + assert_ignored( ExtractAlias, """ defmodule Foo do @@ -159,7 +159,7 @@ defmodule Refactorex.Refactor.Alias.ExtractAliasTest do end test "ignores outside module" do - assert_not_refactored( + assert_ignored( ExtractAlias, """ def foo() do diff --git a/test/refactor/alias/inline_alias_test.exs b/test/refactor/alias/inline_alias_test.exs index 53f62fe..defd392 100644 --- a/test/refactor/alias/inline_alias_test.exs +++ b/test/refactor/alias/inline_alias_test.exs @@ -188,7 +188,7 @@ defmodule Refactorex.Refactor.Alias.InlineAliasTest do end test "ignores alias declaration" do - assert_not_refactored( + assert_ignored( InlineAlias, """ defmodule Foo do @@ -205,7 +205,7 @@ defmodule Refactorex.Refactor.Alias.InlineAliasTest do end test "ignores aliases without same module declaration" do - assert_not_refactored( + assert_ignored( InlineAlias, """ defmodule Foo do diff --git a/test/refactor/alias/merge_aliases_test.exs b/test/refactor/alias/merge_aliases_test.exs index 5ea7ddc..c72732a 100644 --- a/test/refactor/alias/merge_aliases_test.exs +++ b/test/refactor/alias/merge_aliases_test.exs @@ -229,7 +229,7 @@ defmodule Refactorex.Refactor.Alias.MergeAliasesTest do end test "ignores single alias" do - assert_not_refactored( + assert_ignored( MergeAliases, """ defmodule Foo do @@ -242,7 +242,7 @@ defmodule Refactorex.Refactor.Alias.MergeAliasesTest do end test "ignores unmergeable aliases" do - assert_not_refactored( + assert_ignored( MergeAliases, """ defmodule Foo do @@ -256,7 +256,7 @@ defmodule Refactorex.Refactor.Alias.MergeAliasesTest do end test "ignores outside alias" do - assert_not_refactored( + assert_ignored( MergeAliases, """ defmodule Foo do @@ -271,7 +271,7 @@ defmodule Refactorex.Refactor.Alias.MergeAliasesTest do end test "ignores partially selected alias" do - assert_not_refactored( + assert_ignored( MergeAliases, """ defmodule Foo do diff --git a/test/refactor/alias/sort_nested_aliases_test.exs b/test/refactor/alias/sort_nested_aliases_test.exs index c327e59..b09c95f 100644 --- a/test/refactor/alias/sort_nested_aliases_test.exs +++ b/test/refactor/alias/sort_nested_aliases_test.exs @@ -62,7 +62,7 @@ defmodule Refactorex.Refactor.Alias.SortNestedAliasesTest do end test "ignores alias without nesting" do - assert_not_refactored( + assert_ignored( SortNestedAliases, """ # v @@ -72,7 +72,7 @@ defmodule Refactorex.Refactor.Alias.SortNestedAliasesTest do end test "ignores already sorted alias" do - assert_not_refactored( + assert_ignored( SortNestedAliases, """ # v diff --git a/test/refactor/constant/extract_constant_test.exs b/test/refactor/constant/extract_constant_test.exs index 1e5d8b2..f1a120c 100644 --- a/test/refactor/constant/extract_constant_test.exs +++ b/test/refactor/constant/extract_constant_test.exs @@ -162,7 +162,7 @@ defmodule Refactorex.Refactor.Constant.ExtractConstantTest do end test "ignores constants" do - assert_not_refactored( + assert_ignored( ExtractConstant, """ defmodule Foo do @@ -180,7 +180,7 @@ defmodule Refactorex.Refactor.Constant.ExtractConstantTest do end test "ignores anonymous function" do - assert_not_refactored( + assert_ignored( ExtractConstant, """ defmodule Foo do @@ -197,7 +197,7 @@ defmodule Refactorex.Refactor.Constant.ExtractConstantTest do end test "ignores selection ranges with variables" do - assert_not_refactored( + assert_ignored( ExtractConstant, """ defmodule Foo do @@ -212,7 +212,7 @@ defmodule Refactorex.Refactor.Constant.ExtractConstantTest do end test "ignores pipe function calls" do - assert_not_refactored( + assert_ignored( ExtractConstant, """ defmodule Foo do @@ -227,7 +227,7 @@ defmodule Refactorex.Refactor.Constant.ExtractConstantTest do end test "ignores selection ranges outside modules" do - assert_not_refactored( + assert_ignored( ExtractConstant, """ # v @@ -238,7 +238,7 @@ defmodule Refactorex.Refactor.Constant.ExtractConstantTest do end test "ignores alias" do - assert_not_refactored( + assert_ignored( ExtractConstant, """ defmodule Foo do diff --git a/test/refactor/constant/inline_constant_test.exs b/test/refactor/constant/inline_constant_test.exs index eb66777..cfc3be6 100644 --- a/test/refactor/constant/inline_constant_test.exs +++ b/test/refactor/constant/inline_constant_test.exs @@ -56,7 +56,7 @@ defmodule Refactorex.Refactor.Constant.InlineConstantTest do end test "ignores the constant definition" do - assert_not_refactored( + assert_ignored( InlineConstant, """ defmodule Foo do @@ -73,7 +73,7 @@ defmodule Refactorex.Refactor.Constant.InlineConstantTest do end test "ignores constant without a previous definition" do - assert_not_refactored( + assert_ignored( InlineConstant, """ defmodule Foo do diff --git a/test/refactor/constant/rename_constant_test.exs b/test/refactor/constant/rename_constant_test.exs index 551e718..5349cb3 100644 --- a/test/refactor/constant/rename_constant_test.exs +++ b/test/refactor/constant/rename_constant_test.exs @@ -108,7 +108,7 @@ defmodule Refactorex.Refactor.Constant.RenameConstantTest do end test "ignores variables" do - assert_not_refactored( + assert_ignored( RenameConstant, """ defmodule Foo do diff --git a/test/refactor/function/collapse_anonymous_function_test.exs b/test/refactor/function/collapse_anonymous_function_test.exs index 696e483..2b0be79 100644 --- a/test/refactor/function/collapse_anonymous_function_test.exs +++ b/test/refactor/function/collapse_anonymous_function_test.exs @@ -45,7 +45,7 @@ defmodule Refactorex.Refactor.Function.CollapseAnonymousFunctionTest do end test "ignores anonymous function with pattern matching" do - assert_not_refactored( + assert_ignored( CollapseAnonymousFunction, """ # v @@ -56,7 +56,7 @@ defmodule Refactorex.Refactor.Function.CollapseAnonymousFunctionTest do end test "ignores anonymous function with multiples statements" do - assert_not_refactored( + assert_ignored( CollapseAnonymousFunction, """ # v @@ -70,7 +70,7 @@ defmodule Refactorex.Refactor.Function.CollapseAnonymousFunctionTest do end test "ignores anonymous function with multiples clauses" do - assert_not_refactored( + assert_ignored( CollapseAnonymousFunction, """ # v @@ -84,7 +84,7 @@ defmodule Refactorex.Refactor.Function.CollapseAnonymousFunctionTest do end test "ignores anonymous function with zero args" do - assert_not_refactored( + assert_ignored( CollapseAnonymousFunction, """ def foo do @@ -97,7 +97,7 @@ defmodule Refactorex.Refactor.Function.CollapseAnonymousFunctionTest do end test "ignores anonymous function with unused args" do - assert_not_refactored( + assert_ignored( CollapseAnonymousFunction, """ def foo do diff --git a/test/refactor/function/expand_anonymous_function_test.exs b/test/refactor/function/expand_anonymous_function_test.exs index dd55dfc..b0a8ca6 100644 --- a/test/refactor/function/expand_anonymous_function_test.exs +++ b/test/refactor/function/expand_anonymous_function_test.exs @@ -70,7 +70,7 @@ defmodule Refactorex.Refactor.Function.ExpandAnonymousFunctionTest do end test "ignores capture variables" do - assert_not_refactored( + assert_ignored( ExpandAnonymousFunction, """ def foo(modules) do diff --git a/test/refactor/function/extract_anonymous_function_test.exs b/test/refactor/function/extract_anonymous_function_test.exs index fddf1fa..aabd575 100644 --- a/test/refactor/function/extract_anonymous_function_test.exs +++ b/test/refactor/function/extract_anonymous_function_test.exs @@ -450,7 +450,7 @@ defmodule Refactorex.Refactor.Function.ExtractAnonymousFunctionTest do end test "ignores anonymous function that is not inside a module" do - assert_not_refactored( + assert_ignored( ExtractAnonymousFunction, """ def power_sum(numbers, power) do @@ -463,7 +463,7 @@ defmodule Refactorex.Refactor.Function.ExtractAnonymousFunctionTest do end test "ignores anonymous function with zero arguments" do - assert_not_refactored( + assert_ignored( ExtractAnonymousFunction, """ defmodule Middleware do @@ -478,7 +478,7 @@ defmodule Refactorex.Refactor.Function.ExtractAnonymousFunctionTest do end test "ignores already extracted function" do - assert_not_refactored( + assert_ignored( ExtractAnonymousFunction, """ defmodule Foo do diff --git a/test/refactor/function/extract_function_test.exs b/test/refactor/function/extract_function_test.exs index 5ea8a0a..175a683 100644 --- a/test/refactor/function/extract_function_test.exs +++ b/test/refactor/function/extract_function_test.exs @@ -194,7 +194,7 @@ defmodule Refactorex.Refactor.Function.ExtractFunctionTest do end test "ignore with clauses" do - assert_not_refactored( + assert_ignored( ExtractFunction, """ defmodule Foo do @@ -211,7 +211,7 @@ defmodule Refactorex.Refactor.Function.ExtractFunctionTest do end test "ignore module constants" do - assert_not_refactored( + assert_ignored( ExtractFunction, """ defmodule Foo do @@ -228,7 +228,7 @@ defmodule Refactorex.Refactor.Function.ExtractFunctionTest do end test "ignore anonymous functions" do - assert_not_refactored( + assert_ignored( ExtractFunction, """ defmodule Foo do @@ -245,7 +245,7 @@ defmodule Refactorex.Refactor.Function.ExtractFunctionTest do end test "ignore variable declaration functions" do - assert_not_refactored( + assert_ignored( ExtractFunction, """ defmodule Foo do @@ -262,7 +262,7 @@ defmodule Refactorex.Refactor.Function.ExtractFunctionTest do end test "ignores alias" do - assert_not_refactored( + assert_ignored( ExtractFunction, """ defmodule Foo do diff --git a/test/refactor/function/inline_function_test.exs b/test/refactor/function/inline_function_test.exs index fb69b84..ccfd6b4 100644 --- a/test/refactor/function/inline_function_test.exs +++ b/test/refactor/function/inline_function_test.exs @@ -536,7 +536,7 @@ defmodule Refactorex.Refactor.Function.InlineFunctionTest do end test "ignores function definition" do - assert_not_refactored( + assert_ignored( InlineFunction, """ defmodule Foo do @@ -553,7 +553,7 @@ defmodule Refactorex.Refactor.Function.InlineFunctionTest do end test "ignores function call without same module definition" do - assert_not_refactored( + assert_ignored( InlineFunction, """ defmodule Foo do @@ -568,7 +568,7 @@ defmodule Refactorex.Refactor.Function.InlineFunctionTest do end test "ignores function call outside module" do - assert_not_refactored( + assert_ignored( InlineFunction, """ def foo(arg) do diff --git a/test/refactor/function/rename_function_test.exs b/test/refactor/function/rename_function_test.exs index b7f2546..1845e62 100644 --- a/test/refactor/function/rename_function_test.exs +++ b/test/refactor/function/rename_function_test.exs @@ -212,7 +212,7 @@ defmodule Refactorex.Refactor.Function.RenameFunctionTest do end test "ignores function when the definition cannot be found" do - assert_not_refactored( + assert_ignored( RenameFunction, """ defmodule Foo do @@ -227,7 +227,7 @@ defmodule Refactorex.Refactor.Function.RenameFunctionTest do end test "ignores selection outside module" do - assert_not_refactored( + assert_ignored( RenameFunction, """ def foo(arg) do diff --git a/test/refactor/function/underscore_unused_args_test.exs b/test/refactor/function/underscore_unused_args_test.exs index b612f41..850f9f6 100644 --- a/test/refactor/function/underscore_unused_args_test.exs +++ b/test/refactor/function/underscore_unused_args_test.exs @@ -55,7 +55,7 @@ defmodule Refactorex.Refactor.Function.UnderscoreUnusedArgsTest do end test "ignores repeated args used for pattern matching" do - assert_not_refactored( + assert_ignored( UnderscoreUnusedArgs, """ # v @@ -67,7 +67,7 @@ defmodule Refactorex.Refactor.Function.UnderscoreUnusedArgsTest do end test "ignores functions with no args" do - assert_not_refactored( + assert_ignored( UnderscoreUnusedArgs, """ # v @@ -77,7 +77,7 @@ defmodule Refactorex.Refactor.Function.UnderscoreUnusedArgsTest do end test "ignores anonymous functions with no args" do - assert_not_refactored( + assert_ignored( UnderscoreUnusedArgs, """ # v @@ -87,7 +87,7 @@ defmodule Refactorex.Refactor.Function.UnderscoreUnusedArgsTest do end test "ignores already underlined args" do - assert_not_refactored( + assert_ignored( UnderscoreUnusedArgs, """ # v @@ -99,7 +99,7 @@ defmodule Refactorex.Refactor.Function.UnderscoreUnusedArgsTest do end test "ignores pinned args" do - assert_not_refactored( + assert_ignored( UnderscoreUnusedArgs, """ def foo(bar) do @@ -111,7 +111,7 @@ defmodule Refactorex.Refactor.Function.UnderscoreUnusedArgsTest do end test "ignores args used on guards" do - assert_not_refactored( + assert_ignored( UnderscoreUnusedArgs, """ # v diff --git a/test/refactor/function/use_keyword_syntax_test.exs b/test/refactor/function/use_keyword_syntax_test.exs index 50b2e7f..9a8cc41 100644 --- a/test/refactor/function/use_keyword_syntax_test.exs +++ b/test/refactor/function/use_keyword_syntax_test.exs @@ -142,7 +142,7 @@ defmodule Refactorex.Refactor.Function.UseKeywordSyntaxTest do end test "ignores multiple statements functions " do - assert_not_refactored( + assert_ignored( UseKeywordSyntax, """ defmodule Foo do @@ -158,7 +158,7 @@ defmodule Refactorex.Refactor.Function.UseKeywordSyntaxTest do end test "ignores keyword functions" do - assert_not_refactored( + assert_ignored( UseKeywordSyntax, """ defmodule Foo do @@ -170,7 +170,7 @@ defmodule Refactorex.Refactor.Function.UseKeywordSyntaxTest do end test "ignores functions outside range" do - assert_not_refactored( + assert_ignored( UseKeywordSyntax, """ # v diff --git a/test/refactor/function/use_regular_syntax_test.exs b/test/refactor/function/use_regular_syntax_test.exs index 301de0c..9f6f8be 100644 --- a/test/refactor/function/use_regular_syntax_test.exs +++ b/test/refactor/function/use_regular_syntax_test.exs @@ -61,7 +61,7 @@ defmodule Refactorex.Refactor.Function.UseRegularSyntaxTest do end test "ignores regular functions" do - assert_not_refactored( + assert_ignored( UseRegularSyntax, """ defmodule Foo do @@ -75,7 +75,7 @@ defmodule Refactorex.Refactor.Function.UseRegularSyntaxTest do end test "ignores functions outside range" do - assert_not_refactored( + assert_ignored( UseRegularSyntax, """ defmodule Foo do diff --git a/test/refactor/guard/extract_guard_test.exs b/test/refactor/guard/extract_guard_test.exs index b9bf8be..a37d18b 100644 --- a/test/refactor/guard/extract_guard_test.exs +++ b/test/refactor/guard/extract_guard_test.exs @@ -119,7 +119,7 @@ defmodule Refactorex.Refactor.Guard.ExtractGuardTest do end test "ignores statements outside modules" do - assert_not_refactored( + assert_ignored( ExtractGuard, """ # v @@ -132,7 +132,7 @@ defmodule Refactorex.Refactor.Guard.ExtractGuardTest do end test "ignores statements outside WHEN" do - assert_not_refactored( + assert_ignored( ExtractGuard, """ defmodule Foo do @@ -147,7 +147,7 @@ defmodule Refactorex.Refactor.Guard.ExtractGuardTest do end test "ignores incomplete statements" do - assert_not_refactored( + assert_ignored( ExtractGuard, """ defmodule Foo do diff --git a/test/refactor/guard/inline_guard_test.exs b/test/refactor/guard/inline_guard_test.exs index 7899412..68b9ca3 100644 --- a/test/refactor/guard/inline_guard_test.exs +++ b/test/refactor/guard/inline_guard_test.exs @@ -88,7 +88,7 @@ defmodule Refactorex.Refactor.Guard.InlineGuardTest do end test "ignores guard call outside module" do - assert_not_refactored( + assert_ignored( InlineGuard, """ # v @@ -101,7 +101,7 @@ defmodule Refactorex.Refactor.Guard.InlineGuardTest do end test "ignores guard call when the definition is not found" do - assert_not_refactored( + assert_ignored( InlineGuard, """ defmodule Foo do @@ -118,7 +118,7 @@ defmodule Refactorex.Refactor.Guard.InlineGuardTest do end test "ignores other guards statements" do - assert_not_refactored( + assert_ignored( InlineGuard, """ defmodule Foo do @@ -135,7 +135,7 @@ defmodule Refactorex.Refactor.Guard.InlineGuardTest do end test "ignores function call with the same name" do - assert_not_refactored( + assert_ignored( InlineGuard, """ defmodule Foo do diff --git a/test/refactor/guard/rename_guard_test.exs b/test/refactor/guard/rename_guard_test.exs index 85f4bb5..0c3e505 100644 --- a/test/refactor/guard/rename_guard_test.exs +++ b/test/refactor/guard/rename_guard_test.exs @@ -185,7 +185,7 @@ defmodule Refactorex.Refactor.Guard.RenameGuardTest do end test "ignores selection outside module" do - assert_not_refactored( + assert_ignored( RenameGuard, """ # v diff --git a/test/refactor/if_else/use_keyword_syntax_test.exs b/test/refactor/if_else/use_keyword_syntax_test.exs index bd46c4f..d14a7ad 100644 --- a/test/refactor/if_else/use_keyword_syntax_test.exs +++ b/test/refactor/if_else/use_keyword_syntax_test.exs @@ -38,7 +38,7 @@ defmodule Refactorex.Refactor.IfElse.UseKeywordSyntaxTest do end test "ignores if statement with multiple inner statements" do - assert_not_refactored( + assert_ignored( UseKeywordSyntax, """ # v @@ -51,7 +51,7 @@ defmodule Refactorex.Refactor.IfElse.UseKeywordSyntaxTest do end test "ignores if else statement with multiple inner statements" do - assert_not_refactored( + assert_ignored( UseKeywordSyntax, """ # v @@ -66,7 +66,7 @@ defmodule Refactorex.Refactor.IfElse.UseKeywordSyntaxTest do end test "ignores if else statement already with keyword syntax" do - assert_not_refactored( + assert_ignored( UseKeywordSyntax, """ # v diff --git a/test/refactor/if_else/use_regular_syntax_test.exs b/test/refactor/if_else/use_regular_syntax_test.exs index 9a48094..484a85f 100644 --- a/test/refactor/if_else/use_regular_syntax_test.exs +++ b/test/refactor/if_else/use_regular_syntax_test.exs @@ -38,7 +38,7 @@ defmodule Refactorex.Refactor.IfElse.UseRegularSyntaxTest do end test "ignores if else statement already with regular syntax" do - assert_not_refactored( + assert_ignored( UseRegularSyntax, """ # v diff --git a/test/refactor/pipeline/introduce_io_inspect_test.exs b/test/refactor/pipeline/introduce_io_inspect_test.exs index a5fa731..c27b329 100644 --- a/test/refactor/pipeline/introduce_io_inspect_test.exs +++ b/test/refactor/pipeline/introduce_io_inspect_test.exs @@ -22,7 +22,7 @@ defmodule Refactorex.Refactor.Pipeline.IntroduceIOInspectTest do end test "ignores variable declarations" do - assert_not_refactored( + assert_ignored( IntroduceIOInspect, """ # v @@ -35,7 +35,7 @@ defmodule Refactorex.Refactor.Pipeline.IntroduceIOInspectTest do end test "ignores the whole anonymous function" do - assert_not_refactored( + assert_ignored( IntroduceIOInspect, """ foo @@ -47,7 +47,7 @@ defmodule Refactorex.Refactor.Pipeline.IntroduceIOInspectTest do end test "ignores a whole with clause" do - assert_not_refactored( + assert_ignored( IntroduceIOInspect, """ # v @@ -60,7 +60,7 @@ defmodule Refactorex.Refactor.Pipeline.IntroduceIOInspectTest do end test "ignores alias" do - assert_not_refactored( + assert_ignored( IntroduceIOInspect, """ defmodule Foo do diff --git a/test/refactor/pipeline/introduce_pipe_test.exs b/test/refactor/pipeline/introduce_pipe_test.exs index 4f003b8..f79293d 100644 --- a/test/refactor/pipeline/introduce_pipe_test.exs +++ b/test/refactor/pipeline/introduce_pipe_test.exs @@ -188,7 +188,7 @@ defmodule Refactorex.Refactor.Pipeline.IntroducePipeTest do end test "ignores already piped functions" do - assert_not_refactored( + assert_ignored( IntroducePipe, """ # v @@ -198,7 +198,7 @@ defmodule Refactorex.Refactor.Pipeline.IntroducePipeTest do end test "ignores access operations" do - assert_not_refactored( + assert_ignored( IntroducePipe, """ # v @@ -208,7 +208,7 @@ defmodule Refactorex.Refactor.Pipeline.IntroducePipeTest do end test "ignores functions without at least one argument" do - assert_not_refactored( + assert_ignored( IntroducePipe, """ def bar do @@ -220,7 +220,7 @@ defmodule Refactorex.Refactor.Pipeline.IntroducePipeTest do end # test "ignores functions outside range" do - # assert_not_refactored( + # assert_ignored( # IntroducePipe, # """ # def some_function do @@ -230,7 +230,7 @@ defmodule Refactorex.Refactor.Pipeline.IntroducePipeTest do # """ # ) - # assert_not_refactored( + # assert_ignored( # IntroducePipe, # """ # def some_function do @@ -242,7 +242,7 @@ defmodule Refactorex.Refactor.Pipeline.IntroducePipeTest do # end test "ignores anonymous functions" do - assert_not_refactored( + assert_ignored( IntroducePipe, """ list @@ -253,7 +253,7 @@ defmodule Refactorex.Refactor.Pipeline.IntroducePipeTest do end test "ignores alias" do - assert_not_refactored( + assert_ignored( IntroducePipe, """ # v @@ -263,7 +263,7 @@ defmodule Refactorex.Refactor.Pipeline.IntroducePipeTest do end test "ignores function declarations" do - assert_not_refactored( + assert_ignored( IntroducePipe, """ # v @@ -275,7 +275,7 @@ defmodule Refactorex.Refactor.Pipeline.IntroducePipeTest do end test "ignores function declaration with when clause" do - assert_not_refactored( + assert_ignored( IntroducePipe, """ # v @@ -287,7 +287,7 @@ defmodule Refactorex.Refactor.Pipeline.IntroducePipeTest do end test "ignores every thing that is not a function call" do - assert_not_refactored( + assert_ignored( IntroducePipe, """ # v @@ -295,7 +295,7 @@ defmodule Refactorex.Refactor.Pipeline.IntroducePipeTest do """ ) - assert_not_refactored( + assert_ignored( IntroducePipe, """ # v @@ -303,7 +303,7 @@ defmodule Refactorex.Refactor.Pipeline.IntroducePipeTest do """ ) - assert_not_refactored( + assert_ignored( IntroducePipe, """ # v @@ -311,7 +311,7 @@ defmodule Refactorex.Refactor.Pipeline.IntroducePipeTest do """ ) - assert_not_refactored( + assert_ignored( IntroducePipe, """ # v @@ -321,7 +321,7 @@ defmodule Refactorex.Refactor.Pipeline.IntroducePipeTest do end test "ignores range if it's not empty" do - assert_not_refactored( + assert_ignored( IntroducePipe, """ def some_function(arg1, arg2) do diff --git a/test/refactor/pipeline/remove_pipe_test.exs b/test/refactor/pipeline/remove_pipe_test.exs index 1f770bc..b1c5439 100644 --- a/test/refactor/pipeline/remove_pipe_test.exs +++ b/test/refactor/pipeline/remove_pipe_test.exs @@ -77,7 +77,7 @@ defmodule Refactorex.Refactor.Pipeline.RemovePipeTest do end test "ignores range without pipes" do - assert_not_refactored( + assert_ignored( RemovePipe, """ def foo(arg1) do @@ -89,7 +89,7 @@ defmodule Refactorex.Refactor.Pipeline.RemovePipeTest do end test "ignores range outside pipe usage" do - assert_not_refactored( + assert_ignored( RemovePipe, """ # v diff --git a/test/refactor/variable/extract_variable_test.exs b/test/refactor/variable/extract_variable_test.exs index 48a9fa0..83372a0 100644 --- a/test/refactor/variable/extract_variable_test.exs +++ b/test/refactor/variable/extract_variable_test.exs @@ -271,7 +271,7 @@ defmodule Refactorex.Refactor.Variable.ExtractVariableTest do end test "ignores variable declarations" do - assert_not_refactored( + assert_ignored( ExtractVariable, """ quote do @@ -285,7 +285,7 @@ defmodule Refactorex.Refactor.Variable.ExtractVariableTest do end test "ignores part of pipeline" do - assert_not_refactored( + assert_ignored( ExtractVariable, """ quote do @@ -300,7 +300,7 @@ defmodule Refactorex.Refactor.Variable.ExtractVariableTest do end test "ignores alias" do - assert_not_refactored( + assert_ignored( ExtractVariable, """ defmodule Foo do @@ -311,7 +311,7 @@ defmodule Refactorex.Refactor.Variable.ExtractVariableTest do """ ) - assert_not_refactored( + assert_ignored( ExtractVariable, """ defmodule Foo do diff --git a/test/refactor/variable/inline_variable_test.exs b/test/refactor/variable/inline_variable_test.exs index 215e862..fc38e19 100644 --- a/test/refactor/variable/inline_variable_test.exs +++ b/test/refactor/variable/inline_variable_test.exs @@ -212,7 +212,7 @@ defmodule Refactorex.Refactor.Variable.InlineVariableTest do end test "ignore assignment inside other assignment" do - assert_not_refactored( + assert_ignored( InlineVariable, """ defmodule Foo do @@ -228,7 +228,7 @@ defmodule Refactorex.Refactor.Variable.InlineVariableTest do end test "ignores function args" do - assert_not_refactored( + assert_ignored( InlineVariable, """ defmodule Foo do @@ -243,7 +243,7 @@ defmodule Refactorex.Refactor.Variable.InlineVariableTest do end test "ignores variable declaration" do - assert_not_refactored( + assert_ignored( InlineVariable, """ defmodule Foo do diff --git a/test/refactor/variable/rename_variable_test.exs b/test/refactor/variable/rename_variable_test.exs index 4648412..9548db6 100644 --- a/test/refactor/variable/rename_variable_test.exs +++ b/test/refactor/variable/rename_variable_test.exs @@ -252,7 +252,7 @@ defmodule Refactorex.Refactor.Variable.RenameVariableTest do end test "ignores function call values" do - assert_not_refactored( + assert_ignored( RenameVariable, """ defp was_variable_reassigned?(node, name) do @@ -265,7 +265,7 @@ defmodule Refactorex.Refactor.Variable.RenameVariableTest do end test "ignores pinned variables" do - assert_not_refactored( + assert_ignored( RenameVariable, """ defp was_variable_reassigned?(node, name) do diff --git a/test/support/refactor_case.ex b/test/support/refactor_case.ex index ec1862d..b4a9084 100644 --- a/test/support/refactor_case.ex +++ b/test/support/refactor_case.ex @@ -15,10 +15,9 @@ defmodule Refactorex.RefactorCase do end end - defmacro assert_refactored(module, original, expected, opts \\ []) do + defmacro assert_refactored(module, raw? \\ false, original, expected) do quote do module = unquote(module) - opts = unquote(opts) original = unquote(original) |> String.trim() expected = unquote(expected) |> String.trim() |> String.replace("\r", "") @@ -33,15 +32,15 @@ defmodule Refactorex.RefactorCase do refactored = module.execute(zipper, selection_or_line) - if opts[:raw] do - assert Sourceror.parse_string!(expected) == Sourceror.parse_string!(refactored) + if unquote(raw?) do + assert String.split(expected, "\n") == String.split(refactored, "\n") else - expected = assert String.split(expected, "\n") == String.split(refactored, "\n") + assert Sourceror.parse_string!(expected) == Sourceror.parse_string!(refactored) end end end - defmacro assert_not_refactored(module, original, _opts \\ []) do + defmacro assert_ignored(module, original) do quote do module = unquote(module) original = unquote(original)