diff --git a/spec/ameba/rules/line_length_spec.cr b/spec/ameba/rules/line_length_spec.cr index b34bde5c..cdf19676 100644 --- a/spec/ameba/rules/line_length_spec.cr +++ b/spec/ameba/rules/line_length_spec.cr @@ -2,7 +2,7 @@ require "../../spec_helper" module Ameba::Rules subject = LineLength.new - long_line = "*" * 80 + long_line = "*" * 81 describe LineLength do it "passes if all lines are shorter than 80 symbols" do @@ -11,7 +11,7 @@ module Ameba::Rules end it "passes if line consists of 79 symbols" do - source = Source.new "*" * 79 + source = Source.new "*" * 80 subject.catch(source).should be_valid end @@ -27,7 +27,7 @@ module Ameba::Rules error = source.errors.first error.rule.should eq subject error.pos.should eq 1 - error.message.should eq "Line too long (80 symbols)" + error.message.should eq "Line too long (81 symbols)" end end end diff --git a/src/ameba/rules/line_length.cr b/src/ameba/rules/line_length.cr index 3d6e2c0d..150a8045 100644 --- a/src/ameba/rules/line_length.cr +++ b/src/ameba/rules/line_length.cr @@ -1,10 +1,10 @@ module Ameba::Rules - # A rule that disallows lines longer than 79 symbols. + # A rule that disallows lines longer than 80 symbols. # struct LineLength < Rule def test(source) source.lines.each_with_index do |line, index| - next unless line.size > 79 + next unless line.size > 80 source.error self, index + 1, "Line too long (#{line.size} symbols)" end