mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Add ExcludePrefixOperators option to Style/VerboseBlock rule
This commit is contained in:
parent
eed094b928
commit
16743a756c
2 changed files with 24 additions and 1 deletions
|
@ -76,6 +76,20 @@ module Ameba::Rule::Style
|
|||
.catch(source).should_not be_valid
|
||||
end
|
||||
|
||||
it "#exclude_prefix_operators" do
|
||||
source = Source.new %(
|
||||
(1..3).sum { |i| +i }
|
||||
(1..3).sum { |i| -i }
|
||||
)
|
||||
rule = VerboseBlock.new
|
||||
rule
|
||||
.tap(&.exclude_prefix_operators = true)
|
||||
.catch(source).should be_valid
|
||||
rule
|
||||
.tap(&.exclude_prefix_operators = false)
|
||||
.catch(source).should_not be_valid
|
||||
end
|
||||
|
||||
it "#exclude_operators" do
|
||||
source = Source.new %(
|
||||
(1..3).sum { |i| i * 2 }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue