Fix line rule failure

This commit is contained in:
Vitalii Elenhaupt 2017-11-01 12:23:12 +02:00
parent 6f5d7f0478
commit 1822b2b0a2
No known key found for this signature in database
GPG key ID: 7558EF3A4056C706
2 changed files with 7 additions and 2 deletions

View file

@ -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

View file

@ -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