mirror of
https://gitea.invidious.io/iv-org/shard-ameba.git
synced 2024-08-15 00:53:29 +00:00
Fix line rule failure
This commit is contained in:
parent
6f5d7f0478
commit
1822b2b0a2
2 changed files with 7 additions and 2 deletions
|
@ -10,6 +10,11 @@ module Ameba::Rules
|
||||||
subject.catch(source).valid?.should be_true
|
subject.catch(source).valid?.should be_true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "passes if line consists of 79 symbols" do
|
||||||
|
source = Source.new "*" * 79
|
||||||
|
subject.catch(source).valid?.should be_true
|
||||||
|
end
|
||||||
|
|
||||||
it "fails if there is at least one line longer than 79 symbols" do
|
it "fails if there is at least one line longer than 79 symbols" do
|
||||||
source = Source.new long_line
|
source = Source.new long_line
|
||||||
subject.catch(source).valid?.should be_false
|
subject.catch(source).valid?.should be_false
|
||||||
|
|
|
@ -9,8 +9,8 @@ module Ameba::Rules
|
||||||
# false === baz
|
# false === baz
|
||||||
# ```
|
# ```
|
||||||
# This is because these expressions evaluate to `true` or `false`, so you
|
# This is because these expressions evaluate to `true` or `false`, so you
|
||||||
# could get the same result by using either the variable directly, or negating
|
# could get the same result by using either the variable directly,
|
||||||
# the variable.
|
# or negating the variable.
|
||||||
struct ComparisonToBoolean < Rule
|
struct ComparisonToBoolean < Rule
|
||||||
def test(source)
|
def test(source)
|
||||||
CallVisitor.new self, source
|
CallVisitor.new self, source
|
||||||
|
|
Loading…
Reference in a new issue