From cfb6e8d8ca56f72bf32f2c1eb818ae95ea8a873b Mon Sep 17 00:00:00 2001 From: John Backus Date: Sun, 27 Sep 2015 21:15:15 -0700 Subject: [PATCH] Fix maximum line length rule --- config/mutant.yml | 1 - lib/yardstick/rules/summary.rb | 4 ++-- .../yardstick/processor/process_string_spec.rb | 10 +++++----- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/config/mutant.yml b/config/mutant.yml index a16d513..3b0b7d6 100644 --- a/config/mutant.yml +++ b/config/mutant.yml @@ -1,7 +1,6 @@ --- name: yardstick namespace: Yardstick -expect_coverage: 2365/2366 ignore_subjects: # sometimes creates a neutral failure - Yardstick::Rake::Measurement#define diff --git a/lib/yardstick/rules/summary.rb b/lib/yardstick/rules/summary.rb index 3d70eee..c3317a6 100644 --- a/lib/yardstick/rules/summary.rb +++ b/lib/yardstick/rules/summary.rb @@ -34,9 +34,9 @@ def valid? # Checks that method summary length doesn't go over 80 characters # class Length < Rule - MAXIMUM_LINE_LENGTH = 80 + MAXIMUM_LINE_LENGTH = 79 - self.description = 'The method summary should be less than 80 characters in length' + self.description = 'The method summary should be less than or equal to 79 characters in length' # @see class description # diff --git a/spec/integration/yardstick/processor/process_string_spec.rb b/spec/integration/yardstick/processor/process_string_spec.rb index 1dfe62e..f16cd57 100644 --- a/spec/integration/yardstick/processor/process_string_spec.rb +++ b/spec/integration/yardstick/processor/process_string_spec.rb @@ -10,7 +10,7 @@ let(:valid_method) do (<<-RUBY) - # This is a method summary that is the maximum --- exactly 80 characters in length + # This is a method summary that is the maximum -- exactly 79 characters in length # # @example # test('Hello World') # => nil @@ -83,13 +83,13 @@ def measurement(description) end end - describe 'with a method summary that is 80 characters in length' do + describe 'with a method summary that is 79 characters in length' do let(:method) { valid_method } it { should be_kind_of(Yardstick::MeasurementSet) } it 'has a correct measurement' do - expect(measurement('The method summary should be less than 80 characters in length')) + expect(measurement('The method summary should be less than or equal to 79 characters in length')) .to be_ok end end @@ -97,7 +97,7 @@ def measurement(description) describe 'with a method summary that is 81 characters in length' do let(:method) do (<<-RUBY) - # This is a method summary greater than the maximum - it is 81 characters in length + # This is a method summary greater than the maximum - it is precisely 80 characters def test(value) end RUBY @@ -106,7 +106,7 @@ def test(value) it { should be_kind_of(Yardstick::MeasurementSet) } it 'has an incorrect measurement' do - expect(measurement('The method summary should be less than 80 characters in length')) + expect(measurement('The method summary should be less than or equal to 79 characters in length')) .to_not be_ok end end