Making #using_driver specs clearer in light of the fix for issue #452
This commit is contained in:
parent
9dfe35b439
commit
91004eca26
|
@ -68,12 +68,20 @@ describe Capybara::DSL do
|
||||||
driver.should == :selenium
|
driver.should == :selenium
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should reset the driver using Capybara.use_default_driver, even if an exception occurs' do
|
it 'should return the driver to default if it has not been changed' do
|
||||||
|
Capybara.using_driver(:selenium) do
|
||||||
|
Capybara.current_driver.should == :selenium
|
||||||
|
end
|
||||||
|
Capybara.current_driver.should == Capybara.default_driver
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should reset the driver even if an exception occurs' do
|
||||||
|
driver_before_block = Capybara.current_driver
|
||||||
begin
|
begin
|
||||||
Capybara.using_driver(:selenium) { raise "ohnoes!" }
|
Capybara.using_driver(:selenium) { raise "ohnoes!" }
|
||||||
rescue Exception
|
rescue Exception
|
||||||
end
|
end
|
||||||
Capybara.current_driver.should == Capybara.default_driver
|
Capybara.current_driver.should == driver_before_block
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should return the driver to what it was previously' do
|
it 'should return the driver to what it was previously' do
|
||||||
|
|
Loading…
Reference in New Issue