mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Add MaxLineLength option to Style/VerboseBlock rule
This commit is contained in:
parent
a53d44617d
commit
4b7f3ba6ee
2 changed files with 28 additions and 0 deletions
|
@ -90,6 +90,21 @@ module Ameba::Rule::Style
|
|||
.catch(source).should_not be_valid
|
||||
end
|
||||
|
||||
it "#max_line_length" do
|
||||
source = Source.new %(
|
||||
(1..3).tap &.tap &.tap &.tap &.tap &.tap &.tap do |i|
|
||||
i.to_s.reverse.strip.blank?
|
||||
end
|
||||
)
|
||||
rule = VerboseBlock.new
|
||||
rule
|
||||
.tap(&.max_line_length = 60)
|
||||
.catch(source).should be_valid
|
||||
rule
|
||||
.tap(&.max_line_length = nil)
|
||||
.catch(source).should_not be_valid
|
||||
end
|
||||
|
||||
it "#max_length" do
|
||||
source = Source.new %(
|
||||
(1..3).tap { |i| i.to_s.split.reverse.join.strip.blank? }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue