Skip to content

Commit

Permalink
Fix maximum line length rule
Browse files Browse the repository at this point in the history
  • Loading branch information
John Backus committed Sep 29, 2015
1 parent 988c150 commit cfb6e8d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion 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
4 changes: 2 additions & 2 deletions lib/yardstick/rules/summary.rb
Expand Up @@ -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
#
Expand Down
10 changes: 5 additions & 5 deletions spec/integration/yardstick/processor/process_string_spec.rb
Expand Up @@ -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
Expand Down Expand Up @@ -83,21 +83,21 @@ 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

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
Expand All @@ -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
Expand Down

0 comments on commit cfb6e8d

Please sign in to comment.