Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Found these offending spec descriptions while testing out rubocop/rubocop-rspec#259. Searching for duplicate spec descriptions revealed a few categories of issues: 1. Examples with repeated descriptions that tested different cases but didn't describe the specific difference. For example: ```ruby it 'autocorrects' do new_source = autocorrect_source(cop, '"this is the #{}"') expect(new_source).to eq('"this is the "') end it 'autocorrects' do new_source = autocorrect_source(cop, '"this is the #{ }"') expect(new_source).to eq('"this is the "') end ``` 2. Examples with repeated descriptions where one or more descriptions were wrong. For example: ```ruby it 'does not register offense if range startpoint is not constant' do inspect_source(cop, '(a..10).each {}') expect(cop.offenses).to be_empty end it 'does not register offense if range startpoint is not constant' do inspect_source(cop, '(0..b).each {}') expect(cop.offenses).to be_empty end ``` 3. Redundant examples where the spec and its corresponding description showed up twice in the same context. For example: ```ruby it 'picks ruby executable files with no extension' do expect(found_basenames).to include('executable') end # ... it 'picks ruby executable files with no extension' do expect(found_basenames).to include('executable') end ```
- Loading branch information