Minor test improvements

This commit is contained in:
Thomas Walpole 2019-07-23 13:03:00 -07:00
parent eb8fe55b99
commit 7e2d19bde1
3 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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