Skip to content

Commit

Permalink
Fix offenses of naming/variable_name_spec.rb
Browse files Browse the repository at this point in the history
Fix the following offenses.

```console
% bundle exec rake internal_investigation

(snip)

Offenses:

spec/rubocop/cop/naming/variable_name_spec.rb:138:5: C: Don't repeat
examples within an example group.
    it 'registers an offense for snake case in method parameter' do ...
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
spec/rubocop/cop/naming/variable_name_spec.rb:149:5: C: Don't repeat examples within an example group.
    it 'registers an offense for method arguments' do ...
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1019 files inspected, 2 offenses detected
RuboCop failed!
```

This commit removes a redundant test. The following tests are the same.

- https://github.com/bbatsov/rubocop/blob/834262bf83f00462333245547727e102736daccd/spec/rubocop/cop/naming/variable_name_spec.rb#L138-L143
- https://github.com/bbatsov/rubocop/blob/834262bf83f00462333245547727e102736daccd/spec/rubocop/cop/naming/variable_name_spec.rb#L149-L154

I left a more clearer explanation test.
  • Loading branch information
koic authored and bbatsov committed Oct 20, 2017
1 parent 834262b commit 1b00997
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions spec/rubocop/cop/naming/variable_name_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,6 @@ def method(funny_arg); end
expect_no_offenses('_myLocal = 1')
end

it 'registers an offense for method arguments' do
expect_offense(<<-RUBY.strip_indent)
def method(funny_arg); end
^^^^^^^^^ Use camelCase for variable names.
RUBY
end

it 'registers an offense for default method arguments' do
expect_offense(<<-RUBY.strip_indent)
def foo(opt_arg = 1); end
Expand Down

0 comments on commit 1b00997

Please sign in to comment.