Skip to content

Commit

Permalink
Fix new Style/SelectByRegexp offenses.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvandersluis authored and bbatsov committed Sep 28, 2021
1 parent a3f9b58 commit eed36a1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions spec/rubocop/cli/auto_gen_config_spec.rb
Expand Up @@ -824,7 +824,7 @@ def a; end
- 'example1.rb'
- 'example2.rb'
YAML
actual = File.read('.rubocop_todo.yml').lines.reject { |line| line =~ /^(#.*)?$/ }
actual = File.read('.rubocop_todo.yml').lines.grep_v(/^(#.*)?$/)
expect(actual.join).to eq(expected)

$stdout = StringIO.new
Expand All @@ -842,7 +842,7 @@ def a; end
Exclude:
- 'example2.rb'
YAML
actual = File.read('.rubocop_todo.yml').lines.reject { |line| line =~ /^(#.*)?$/ }
actual = File.read('.rubocop_todo.yml').lines.grep_v(/^(#.*)?$/)
expect(actual.join).to eq(expected)

expect(cli.run([])).to eq(0)
Expand Down
2 changes: 1 addition & 1 deletion spec/support/alignment_examples.rb
Expand Up @@ -10,7 +10,7 @@
end
annotated_source.split("\n\n").each do |chunk|
chunk << "\n" unless chunk.end_with?("\n")
source = chunk.lines.reject { |line| /^ *\^/.match?(line) }.join
source = chunk.lines.grep_v(/^ *\^/).join
name = source.gsub(/\n(?=[a-z ])/, ' <newline> ').gsub(/\s+/, ' ')

it "registers an offense for mismatched #{name} and autocorrects" do
Expand Down

0 comments on commit eed36a1

Please sign in to comment.