Fix for socket-stubbing test to ensure it doesn't prevent the tests that follow from passing.
This commit is contained in:
parent
a90e31d17c
commit
344b0515ae
|
@ -756,9 +756,8 @@ describe Capybara::Driver::Webkit do
|
||||||
end
|
end
|
||||||
|
|
||||||
it "raises a webkit error for the requested url" do
|
it "raises a webkit error for the requested url" do
|
||||||
expect {
|
|
||||||
subject.find("//input").first.click
|
|
||||||
make_the_server_go_away
|
make_the_server_go_away
|
||||||
|
expect {
|
||||||
subject.find("//body")
|
subject.find("//body")
|
||||||
}.
|
}.
|
||||||
to raise_error(Capybara::Driver::Webkit::WebkitNoResponseError, %r{response})
|
to raise_error(Capybara::Driver::Webkit::WebkitNoResponseError, %r{response})
|
||||||
|
@ -767,10 +766,14 @@ describe Capybara::Driver::Webkit do
|
||||||
|
|
||||||
def make_the_server_come_back
|
def make_the_server_come_back
|
||||||
subject.browser.instance_variable_get(:@socket).unstub!(:gets)
|
subject.browser.instance_variable_get(:@socket).unstub!(:gets)
|
||||||
|
subject.browser.instance_variable_get(:@socket).unstub!(:puts)
|
||||||
|
subject.browser.instance_variable_get(:@socket).unstub!(:print)
|
||||||
end
|
end
|
||||||
|
|
||||||
def make_the_server_go_away
|
def make_the_server_go_away
|
||||||
subject.browser.instance_variable_get(:@socket).stub!(:gets).and_return(nil)
|
subject.browser.instance_variable_get(:@socket).stub!(:gets).and_return(nil)
|
||||||
|
subject.browser.instance_variable_get(:@socket).stub!(:puts)
|
||||||
|
subject.browser.instance_variable_get(:@socket).stub!(:print)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue