From 571e5cb6b64db35b6b4850d29d6b5f879bbbc315 Mon Sep 17 00:00:00 2001 From: John Backus Date: Sat, 3 Oct 2015 00:43:21 -0700 Subject: [PATCH] Change `@api` tag rule descriptions --- lib/yardstick/rules/api_tag.rb | 8 ++++---- .../processor/process_string_spec.rb | 20 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/yardstick/rules/api_tag.rb b/lib/yardstick/rules/api_tag.rb index f9eca69..42190d6 100644 --- a/lib/yardstick/rules/api_tag.rb +++ b/lib/yardstick/rules/api_tag.rb @@ -8,7 +8,7 @@ class ApiTag # Checks if @api tag is present # class Presence < Rule - self.description = 'The @api tag should be specified' + self.description = '@api should be specified' # @see class description # @@ -26,7 +26,7 @@ def valid? class Inclusion < Rule VALID_VALUES = %w[public semipublic private].freeze - self.description = 'The @api tag must be either public, semipublic or private' + self.description = '@api should be public, semipublic, or private' # @see class description # @@ -42,7 +42,7 @@ def valid? # Checks if protected method has correct @api visibility # class ProtectedMethod < Rule - self.description = 'A method with protected visibility must have an @api tag of semipublic or private' + self.description = '@api should be semipublic or private for protected methods' # @see Rule::validatable? # @@ -68,7 +68,7 @@ def valid? # Checks if private method has correct @api visibility # class PrivateMethod < Rule - self.description = 'A method with private visibility must have an @api tag of private' + self.description = '@api should be private for private methods' # @see Rule::validatable? # diff --git a/spec/integration/yardstick/processor/process_string_spec.rb b/spec/integration/yardstick/processor/process_string_spec.rb index b218906..4ecc014 100644 --- a/spec/integration/yardstick/processor/process_string_spec.rb +++ b/spec/integration/yardstick/processor/process_string_spec.rb @@ -221,7 +221,7 @@ def test(value) it { should be_kind_of(Yardstick::MeasurementSet) } it 'has a correct measurement' do - expect(measurement('The @api tag should be specified')) + expect(measurement('@api should be specified')) .to be_ok end end @@ -232,7 +232,7 @@ def test(value) it { should be_kind_of(Yardstick::MeasurementSet) } it 'has an incorrect measurement' do - expect(measurement('The @api tag should be specified')) + expect(measurement('@api should be specified')) .to_not be_ok end end @@ -243,7 +243,7 @@ def test(value) it { should be_kind_of(Yardstick::MeasurementSet) } it 'has a correct measurement' do - expect(measurement('The @api tag must be either public, semipublic or private')) + expect(measurement('@api should be public, semipublic, or private')) .to be_ok end end @@ -260,7 +260,7 @@ def test(value) it { should be_kind_of(Yardstick::MeasurementSet) } it 'has an incorrect measurement' do - expect(measurement('The @api tag must be either public, semipublic or private')) + expect(measurement('@api should be public, semipublic, or private')) .to_not be_ok end end @@ -279,7 +279,7 @@ def test(value) it { should be_kind_of(Yardstick::MeasurementSet) } it 'has a correct measurement' do - expect(measurement('A method with protected visibility must have an @api tag of semipublic or private')) + expect(measurement('@api should be semipublic or private for protected methods')) .to be_ok end end @@ -298,7 +298,7 @@ def test(value) it { should be_kind_of(Yardstick::MeasurementSet) } it 'has a correct measurement' do - expect(measurement('A method with protected visibility must have an @api tag of semipublic or private')) + expect(measurement('@api should be semipublic or private for protected methods')) .to be_ok end end @@ -317,7 +317,7 @@ def test(value) it { should be_kind_of(Yardstick::MeasurementSet) } it 'has an incorrect measurement' do - expect(measurement('A method with protected visibility must have an @api tag of semipublic or private')) + expect(measurement('@api should be semipublic or private for protected methods')) .to_not be_ok end end @@ -336,7 +336,7 @@ def test(value) it { should be_kind_of(Yardstick::MeasurementSet) } it 'has a correct measurement' do - expect(measurement('A method with private visibility must have an @api tag of private')) + expect(measurement('@api should be private for private methods')) .to be_ok end end @@ -355,7 +355,7 @@ def test(value) it { should be_kind_of(Yardstick::MeasurementSet) } it 'has an incorrect measurement' do - expect(measurement('A method with private visibility must have an @api tag of private')) + expect(measurement('@api should be private for private methods')) .to_not be_ok end end @@ -374,7 +374,7 @@ def test(value) it { should be_kind_of(Yardstick::MeasurementSet) } it 'has an incorrect measurement' do - expect(measurement('A method with private visibility must have an @api tag of private')) + expect(measurement('@api should be private for private methods')) .to_not be_ok end end