Skip to content

Commit

Permalink
Merge pull request rubocop#9797 from koic/make_internal_affairs_examp…
Browse files Browse the repository at this point in the history
…le_description_aware_of_several_words

Make `InternalAffairs/ExampleDescription` aware of several words
  • Loading branch information
koic committed May 14, 2021
2 parents 9c92575 + 91ebcdb commit f3a1d32
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion lib/rubocop/cop/internal_affairs/example_description.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class << self

EXPECT_NO_OFFENSES_INCORRECT_DESCRIPTIONS = [
/^(adds|registers|reports|finds) (an? )?offense/,
/^flags\b/
/^(flags|handles|works)\b/
].freeze

EXPECT_OFFENSE_INCORRECT_DESCRIPTIONS = [
Expand Down
2 changes: 1 addition & 1 deletion spec/rubocop/cop/layout/condition_position_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
RUBY
end

it 'handles ternary ops' do
it 'accepts ternary ops' do
expect_no_offenses('x ? a : b')
end
end
4 changes: 2 additions & 2 deletions spec/rubocop/cop/layout/empty_lines_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
RUBY
end

it 'works when there are no tokens' do
it 'does not register an offense when there are no tokens' do
expect_no_offenses('#comment')
end

it 'handles comments' do
it 'does not register an offense for comments' do
expect_no_offenses(<<~RUBY)
test
Expand Down
6 changes: 3 additions & 3 deletions spec/rubocop/cop/lint/else_layout_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@
RUBY
end

it 'handles ternary ops' do
it 'accepts ternary ops' do
expect_no_offenses('x ? a : b')
end

it 'handles modifier forms' do
it 'accepts modifier forms' do
expect_no_offenses('x if something')
end

it 'handles empty braces' do
it 'accepts empty braces' do
expect_no_offenses(<<~RUBY)
if something
()
Expand Down
4 changes: 2 additions & 2 deletions spec/rubocop/cop/lint/out_of_range_regexp_ref_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@
RUBY
end

it 'handles `match` with no arguments' do
it 'ignores `match` with no arguments' do
expect_no_offenses(<<~RUBY)
foo.match
RUBY
end

it 'handles `match` with no receiver' do
it 'ignores `match` with no receiver' do
expect_no_offenses(<<~RUBY)
match(bar)
RUBY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@
RUBY
end

it 'handles break with no value' do
it 'allows break with no value' do
expect_no_offenses(<<~RUBY)
foo.#{method}([]) do |acc, el|
break if something?
Expand Down
2 changes: 1 addition & 1 deletion spec/rubocop/cop/lint/useless_setter_call_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ def test
RUBY
end

it 'handles exception assignments without exploding' do
it 'accepts exception assignments without exploding' do
expect_no_offenses(<<~RUBY)
def foo(bar)
begin
Expand Down
2 changes: 1 addition & 1 deletion spec/rubocop/cop/lint/void_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def foo=(rhs)
RUBY
end

it 'handles empty block' do
it 'accepts empty block' do
expect_no_offenses(<<~RUBY)
array.each { |_item| }
RUBY
Expand Down
2 changes: 1 addition & 1 deletion spec/rubocop/cop/naming/method_name_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ def self.foo_bar
include_examples 'multiple attr methods', 'camelCase'
end

it 'works for non-ascii characters' do
it 'accepts for non-ascii characters' do
expect_no_offenses(<<~RUBY)
def última_vista; end
RUBY
Expand Down
2 changes: 1 addition & 1 deletion spec/rubocop/cop/naming/variable_name_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ def foo(&block_arg); end
RUBY
end

it 'works with non-ascii characters' do
it 'accepts with non-ascii characters' do
expect_no_offenses('léo = 1')
end

Expand Down
14 changes: 7 additions & 7 deletions spec/rubocop/cop/style/document_dynamic_eval_definition_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def capitalize(*params, &block)
RUBY
end

it 'handles inline comments' do
it 'does not register an offense when using inline comments' do
expect_no_offenses(<<~RUBY)
class_eval <<-EOT, __FILE__, __LINE__ + 1
# def capitalize(*params, &block)
Expand All @@ -88,7 +88,7 @@ def \#{unsafe_method}(*params, &block)
RUBY
end

it 'handles other text' do
it 'does not register an offense when using other text' do
expect_no_offenses(<<~RUBY)
class_eval <<-EOT, __FILE__, __LINE__ + 1
# EXAMPLE: def capitalize(*params, &block)
Expand All @@ -102,7 +102,7 @@ def \#{unsafe_method}(*params, &block)
RUBY
end

it 'handles multiple methods' do
it 'does not register an offense when using multiple methods' do
expect_no_offenses(<<~RUBY)
class_eval <<-EOT, __FILE__, __LINE__ + 1
# def capitalize(*params, &block)
Expand All @@ -126,7 +126,7 @@ def \#{unsafe_method}!(*params)
RUBY
end

it 'handles multiple methods with split comments' do
it 'does not register an offense when using multiple methods with split comments' do
expect_no_offenses(<<~RUBY)
class_eval <<-EOT, __FILE__, __LINE__ + 1
# def capitalize(*params, &block)
Expand Down Expand Up @@ -196,7 +196,7 @@ def \#{unsafe_method}(*params, &block)
RUBY
end

it 'handles inline comments' do
it 'does not register an offense when using inline comments' do
expect_no_offenses(<<~RUBY)
class_eval(
# def capitalize(*params, &block)
Expand All @@ -212,7 +212,7 @@ def \#{unsafe_method}(*params, &block)
RUBY
end

it 'handles other text' do
it 'does not register an offense when using other text' do
expect_no_offenses(<<~RUBY)
class_eval(
# EXAMPLE: def capitalize(*params, &block)
Expand Down Expand Up @@ -245,7 +245,7 @@ def \#{unsafe_method}(*params, &block)
RUBY
end

it 'handles multiple methods' do
it 'does not register an offense when using multiple methods' do
expect_no_offenses(<<~RUBY)
class_eval(
# def capitalize(*params, &block)
Expand Down
2 changes: 1 addition & 1 deletion spec/rubocop/cop/style/format_string_token_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
expect_no_corrections
end

it 'handles __FILE__' do
it 'ignores __FILE__' do
expect_no_offenses('__FILE__')
end

Expand Down

0 comments on commit f3a1d32

Please sign in to comment.