Wait for app server to boot on 0.0.0.0 instead of application_address
application_address is used to know where Selenium should navitate to, but we always are booting app servers on 0.0.0.0 so that's where we should verify they exist
This commit is contained in:
parent
9b5b9fad62
commit
28f19616d6
@ -1,3 +1,5 @@
|
||||
require "webrat/selenium/silence_stream"
|
||||
|
||||
module Webrat
|
||||
module Selenium
|
||||
module ApplicationServers
|
||||
@ -25,9 +27,9 @@ module Webrat
|
||||
def wait_for_socket
|
||||
silence_stream(STDOUT) do
|
||||
TCPSocket.wait_for_service_with_timeout \
|
||||
:host => Webrat.configuration.application_address,
|
||||
:port => Webrat.configuration.application_port.to_i,
|
||||
:timeout => 30 # seconds
|
||||
:host => "0.0.0.0",
|
||||
:port => Webrat.configuration.application_port.to_i,
|
||||
:timeout => 30 # seconds
|
||||
end
|
||||
rescue SocketError
|
||||
fail
|
||||
|
@ -1,3 +1,5 @@
|
||||
require "webrat/selenium/application_servers/base"
|
||||
|
||||
module Webrat
|
||||
module Selenium
|
||||
module ApplicationServers
|
||||
|
@ -1,3 +1,5 @@
|
||||
require "webrat/selenium/application_servers/base"
|
||||
|
||||
module Webrat
|
||||
module Selenium
|
||||
module ApplicationServers
|
||||
|
@ -1,3 +1,5 @@
|
||||
require "webrat/selenium/application_servers/base"
|
||||
|
||||
module Webrat
|
||||
module Selenium
|
||||
module ApplicationServers
|
||||
|
@ -1,3 +1,5 @@
|
||||
require "webrat/selenium/application_servers/base"
|
||||
|
||||
module Webrat
|
||||
module Selenium
|
||||
module ApplicationServers
|
||||
|
26
spec/private/selenium/application_servers/rails_spec.rb
Normal file
26
spec/private/selenium/application_servers/rails_spec.rb
Normal file
@ -0,0 +1,26 @@
|
||||
require File.expand_path(File.dirname(__FILE__) + "/../../../spec_helper")
|
||||
require "webrat/selenium/application_servers/rails"
|
||||
|
||||
RAILS_ROOT = "." unless defined?(RAILS_ROOT)
|
||||
|
||||
describe Webrat::Selenium::ApplicationServers::Rails do
|
||||
include Webrat::Selenium::SilenceStream
|
||||
|
||||
before do
|
||||
@server = Webrat::Selenium::ApplicationServers::Rails.new
|
||||
# require "rubygems"; require "ruby-debug"; Debugger.start; debugger
|
||||
@server.stub!(:system)
|
||||
@server.stub!(:at_exit)
|
||||
end
|
||||
|
||||
describe "boot" do
|
||||
it "should wait for the server to start on 0.0.0.0" do
|
||||
TCPSocket.should_receive(:wait_for_service_with_timeout).
|
||||
with(hash_including(:host => "0.0.0.0"))
|
||||
|
||||
silence_stream(STDERR) do
|
||||
@server.boot
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user