Merge branch 'master' into develop

This commit is contained in:
Vitalii Elenhaupt 2021-04-04 21:08:02 +03:00
commit 58d7775d65
No known key found for this signature in database
GPG key ID: CD0BF17825928BC0
6 changed files with 19 additions and 4 deletions

View file

@ -26,6 +26,15 @@ module Ameba::Rule::Style
subject.catch(source).should_not be_valid
end
it "does not report if there .is_a? call within block with multiple arguments" do
source = Source.new %(
t.all? { |_, v| v.is_a?(String) }
t.all? { |foo, bar| foo.is_a?(String) }
t.all? { |foo, bar| bar.is_a?(String) }
)
subject.catch(source).should be_valid
end
context "properties" do
it "allows to configure filter_names" do
source = Source.new %(

View file

@ -92,6 +92,7 @@ module Ameba::Rule::Style
.catch(source).should be_valid
rule
.tap(&.exclude_prefix_operators = false)
.tap(&.exclude_operators = false)
.catch(source).should_not be_valid
end
@ -190,7 +191,10 @@ module Ameba::Rule::Style
(1..3).map { |i| i.in?(1, *foo, 3, **bar) }
(1..3).join(separator: '.') { |i| i.to_s }
)
subject.catch(source).should_not be_valid
rule = VerboseBlock.new
rule
.tap(&.exclude_operators = false)
.catch(source).should_not be_valid
source.issues.size.should eq(short_block_variants.size)
source.issues.each_with_index do |issue, i|