From ea8e1910d101f221079dbc0ca995883f3cbb8e53 Mon Sep 17 00:00:00 2001 From: "T.J. VanSlyke" Date: Fri, 30 Jan 2009 11:37:43 -0800 Subject: [PATCH] Added single-quotes around --chdir argument to mongrel_rails call, as webrat bombs with a file not found error if RAILS_ROOT contains a space. --- lib/webrat/selenium.rb | 2 +- spec/private/selenium/selenium_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/webrat/selenium.rb b/lib/webrat/selenium.rb index 688901fd..d2451917 100644 --- a/lib/webrat/selenium.rb +++ b/lib/webrat/selenium.rb @@ -27,7 +27,7 @@ def self.stop_selenium_server #:nodoc: def self.start_app_server #:nodoc: pid_file = prepare_pid_file("#{RAILS_ROOT}/tmp/pids", "mongrel_selenium.pid") - system("mongrel_rails start -d --chdir=#{RAILS_ROOT} --port=#{Webrat.configuration.application_port} --environment=#{Webrat.configuration.application_environment} --pid #{pid_file} &") + system("mongrel_rails start -d --chdir='#{RAILS_ROOT}' --port=#{Webrat.configuration.application_port} --environment=#{Webrat.configuration.application_environment} --pid #{pid_file} &") TCPSocket.wait_for_service :host => Webrat.configuration.application_address, :port => Webrat.configuration.application_port.to_i end diff --git a/spec/private/selenium/selenium_spec.rb b/spec/private/selenium/selenium_spec.rb index 937ed619..62235d60 100644 --- a/spec/private/selenium/selenium_spec.rb +++ b/spec/private/selenium/selenium_spec.rb @@ -11,7 +11,7 @@ it "should start the app server with correct config options" do pid_file = "file" Webrat.should_receive(:prepare_pid_file).with("#{RAILS_ROOT}/tmp/pids","mongrel_selenium.pid").and_return pid_file - Webrat.should_receive(:system).with("mongrel_rails start -d --chdir=#{RAILS_ROOT} --port=#{Webrat.configuration.application_port} --environment=#{Webrat.configuration.application_environment} --pid #{pid_file} &") + Webrat.should_receive(:system).with("mongrel_rails start -d --chdir='#{RAILS_ROOT}' --port=#{Webrat.configuration.application_port} --environment=#{Webrat.configuration.application_environment} --pid #{pid_file} &") TCPSocket.should_receive(:wait_for_service).with(:host => Webrat.configuration.application_address, :port => Webrat.configuration.application_port.to_i) Webrat.start_app_server end @@ -56,4 +56,4 @@ Webrat.stop_selenium_server end end -end \ No newline at end of file +end