mirror of
https://github.com/teamcapybara/capybara.git
synced 2022-11-09 12:08:07 -05:00
Fix tests for 2.7 behavior change
This commit is contained in:
parent
1410793107
commit
553975782a
2 changed files with 6 additions and 6 deletions
|
@ -15,7 +15,7 @@ Capybara::SpecHelper.spec '#save_and_open_screenshot' do
|
|||
@session.save_and_open_screenshot
|
||||
|
||||
expect(@session.driver).to have_received(:save_screenshot)
|
||||
.with(expected_file_regex, {})
|
||||
.with(expected_file_regex, any_args)
|
||||
expect(Launchy).to have_received(:open).with(expected_file_regex)
|
||||
end
|
||||
|
||||
|
@ -27,7 +27,7 @@ Capybara::SpecHelper.spec '#save_and_open_screenshot' do
|
|||
@session.save_and_open_screenshot(custom_path)
|
||||
|
||||
expect(@session.driver).to have_received(:save_screenshot)
|
||||
.with(/#{custom_path}$/, {})
|
||||
.with(/#{custom_path}$/, any_args)
|
||||
expect(Launchy).to have_received(:open).with(/#{custom_path}$/)
|
||||
end
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ Capybara::SpecHelper.spec '#save_screenshot', requires: [:screenshot] do
|
|||
@session.save_screenshot
|
||||
|
||||
regexp = Regexp.new(File.join(Dir.pwd, 'capybara-\d+\.png'))
|
||||
expect(@session.driver).to have_received(:save_screenshot).with(regexp, {})
|
||||
expect(@session.driver).to have_received(:save_screenshot).with(regexp, any_args)
|
||||
end
|
||||
|
||||
it 'allows to specify another path' do
|
||||
|
@ -28,7 +28,7 @@ Capybara::SpecHelper.spec '#save_screenshot', requires: [:screenshot] do
|
|||
custom_path = 'screenshots/1.png'
|
||||
@session.save_screenshot(custom_path)
|
||||
|
||||
expect(@session.driver).to have_received(:save_screenshot).with(/#{custom_path}$/, {})
|
||||
expect(@session.driver).to have_received(:save_screenshot).with(/#{custom_path}$/, any_args)
|
||||
end
|
||||
|
||||
context 'with Capybara.save_path' do
|
||||
|
@ -39,7 +39,7 @@ Capybara::SpecHelper.spec '#save_screenshot', requires: [:screenshot] do
|
|||
@session.save_screenshot
|
||||
|
||||
regexp = Regexp.new(File.join(alternative_path, 'capybara-\d+\.png'))
|
||||
expect(@session.driver).to have_received(:save_screenshot).with(regexp, {})
|
||||
expect(@session.driver).to have_received(:save_screenshot).with(regexp, any_args)
|
||||
end
|
||||
|
||||
it 'relative paths are relative to save_path' do
|
||||
|
@ -49,7 +49,7 @@ Capybara::SpecHelper.spec '#save_screenshot', requires: [:screenshot] do
|
|||
custom_path = 'screenshots/2.png'
|
||||
@session.save_screenshot(custom_path)
|
||||
|
||||
expect(@session.driver).to have_received(:save_screenshot).with(File.expand_path(custom_path, alternative_path), {})
|
||||
expect(@session.driver).to have_received(:save_screenshot).with(File.expand_path(custom_path, alternative_path), any_args)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue