Minor test improvements
This commit is contained in:
parent
eb8fe55b99
commit
7e2d19bde1
|
@ -44,7 +44,7 @@ RSpec.describe Capybara::Selector::RegexpDisassembler, :aggregate_failures do
|
||||||
/abc?def?g/ => %w[ab de g],
|
/abc?def?g/ => %w[ab de g],
|
||||||
/d?/ => []
|
/d?/ => []
|
||||||
}.each do |regexp, expected|
|
}.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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ RSpec.describe Capybara::Selector::RegexpDisassembler, :aggregate_failures do
|
||||||
/ab(cd|cd)?ef/ => %w[ab ef],
|
/ab(cd|cd)?ef/ => %w[ab ef],
|
||||||
/ab\\?cd/ => %w[ab cd]
|
/ab\\?cd/ => %w[ab cd]
|
||||||
}.each do |regexp, expected|
|
}.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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -682,12 +682,12 @@ RSpec.shared_examples Capybara::RSpecMatchers do |session, _mode|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'treats a given value as a string' do
|
it 'treats a given value as a string' do
|
||||||
class Foo
|
foo = Class.new do
|
||||||
def to_s
|
def to_s
|
||||||
'some value'
|
'some value'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
expect(html).to have_field('Text field', with: Foo.new)
|
expect(html).to have_field('Text field', with: foo.new)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'supports compounding' do
|
it 'supports compounding' do
|
||||||
|
|
|
@ -76,7 +76,7 @@ RSpec.describe 'capybara/rspec' do
|
||||||
context 'Type: Other', type: :other do
|
context 'Type: Other', type: :other do
|
||||||
context 'when RSpec::Matchers is included after Capybara::DSL' do
|
context 'when RSpec::Matchers is included after Capybara::DSL' do
|
||||||
let(:test_class_instance) do
|
let(:test_class_instance) do
|
||||||
class DSLMatchersTest
|
Class.new do
|
||||||
include Capybara::DSL
|
include Capybara::DSL
|
||||||
include RSpec::Matchers
|
include RSpec::Matchers
|
||||||
end.new
|
end.new
|
||||||
|
|
Loading…
Reference in New Issue