diff --git a/spec/regexp_dissassembler_spec.rb b/spec/regexp_dissassembler_spec.rb index a52aca8e..59dfcfd2 100644 --- a/spec/regexp_dissassembler_spec.rb +++ b/spec/regexp_dissassembler_spec.rb @@ -44,7 +44,7 @@ RSpec.describe Capybara::Selector::RegexpDisassembler, :aggregate_failures do /abc?def?g/ => %w[ab de g], /d?/ => [] }.each do |regexp, expected| - expect(Capybara::Selector::RegexpDisassembler.new(regexp).substrings).to eq expected + expect(described_class.new(regexp).substrings).to eq expected end end @@ -131,7 +131,7 @@ RSpec.describe Capybara::Selector::RegexpDisassembler, :aggregate_failures do /ab(cd|cd)?ef/ => %w[ab ef], /ab\\?cd/ => %w[ab cd] }.each do |regexp, expected| - expect(Capybara::Selector::RegexpDisassembler.new(regexp).substrings).to eq expected + expect(described_class.new(regexp).substrings).to eq expected end end diff --git a/spec/rspec/shared_spec_matchers.rb b/spec/rspec/shared_spec_matchers.rb index 76c00f02..072785aa 100644 --- a/spec/rspec/shared_spec_matchers.rb +++ b/spec/rspec/shared_spec_matchers.rb @@ -682,12 +682,12 @@ RSpec.shared_examples Capybara::RSpecMatchers do |session, _mode| end it 'treats a given value as a string' do - class Foo + foo = Class.new do def to_s 'some value' end end - expect(html).to have_field('Text field', with: Foo.new) + expect(html).to have_field('Text field', with: foo.new) end it 'supports compounding' do diff --git a/spec/rspec_spec.rb b/spec/rspec_spec.rb index be860562..d13e3374 100644 --- a/spec/rspec_spec.rb +++ b/spec/rspec_spec.rb @@ -76,7 +76,7 @@ RSpec.describe 'capybara/rspec' do context 'Type: Other', type: :other do context 'when RSpec::Matchers is included after Capybara::DSL' do let(:test_class_instance) do - class DSLMatchersTest + Class.new do include Capybara::DSL include RSpec::Matchers end.new