diff --git a/spec/expression/methods/printing_spec.rb b/spec/expression/methods/printing_spec.rb index 6646a15..27ac6e5 100644 --- a/spec/expression/methods/printing_spec.rb +++ b/spec/expression/methods/printing_spec.rb @@ -19,7 +19,7 @@ RSpec.describe('Expression::Shared#pretty_print') do it 'works' do - require 'pp' # rubocop:disable Lint/RedundantRequireStatement + require 'pp' pp_to_s = ->(arg) { ''.dup.tap { |buffer| PP.new(buffer).pp(arg) } } root = Regexp::Parser.parse(/(a)+/) diff --git a/spec/scanner/sets_spec.rb b/spec/scanner/sets_spec.rb index e8a72c2..1ce6f45 100644 --- a/spec/scanner/sets_spec.rb +++ b/spec/scanner/sets_spec.rb @@ -87,7 +87,8 @@ include_examples 'scan', /[a-bd-f]/, 2 => [:set, :range, '-', 2, 3] include_examples 'scan', /[a-cd-f]/, 5 => [:set, :range, '-', 5, 6] # this is a buggy range, it matches only `c`, but not `a`, `b` or `-` - include_examples 'scan', /[a-[c]]/, 2 => [:set, :range, '-', 2, 3] + # (this is a string to work around a rubocop error in Lint/MixedCaseRange) + include_examples 'scan', '[a-[c]]', 2 => [:set, :range, '-', 2, 3] # these are not ranges, they match `a`, `c` and `-` (or non-`-` if negated) include_examples 'scan', /[[a]-[c]]/, 4 => [:literal, :literal, '-', 4, 5] include_examples 'scan', /[[a]-c]/, 4 => [:literal, :literal, '-', 4, 5]