diff --git a/lib/webrat/selenium.rb b/lib/webrat/selenium.rb index c2cb039..28a9485 100644 --- a/lib/webrat/selenium.rb +++ b/lib/webrat/selenium.rb @@ -26,7 +26,7 @@ module Webrat def self.start_app_server #:nodoc: pid_file = File.expand_path(RAILS_ROOT + "/tmp/pids/mongrel_selenium.pid") - system("mongrel_rails start -d --chdir=#{RAILS_ROOT} --port=#{Webrat.configuration.selenium_port.to_s} --environment=#{Webrat.configuration.selenium_environment.to_s} --pid #{pid_file} &") + system("mongrel_rails start -d --chdir=#{RAILS_ROOT} --port=#{Webrat.configuration.selenium_port} --environment=#{Webrat.configuration.selenium_environment} --pid #{pid_file} &") TCPSocket.wait_for_service :host => "0.0.0.0", :port => Webrat.configuration.selenium_port.to_i end diff --git a/spec/webrat/core/configuration_spec.rb b/spec/webrat/core/configuration_spec.rb index 00045af..b29d473 100755 --- a/spec/webrat/core/configuration_spec.rb +++ b/spec/webrat/core/configuration_spec.rb @@ -25,23 +25,23 @@ describe Webrat::Configuration do config.should open_error_files end - it "should have selenium setting defaults" do + it "should use 'selenium' as the selenium environment by default" do config = Webrat::Configuration.new config.selenium_environment.should == :selenium - config.selenium_port.should == 3001 end + it "should use 3001 as the selenium port by default" do + config = Webrat::Configuration.new + config.selenium_port.should == 3001 + end + it "should be configurable with a block" do Webrat.configure do |config| config.open_error_files = false - config.selenium_environment = :test - config.selenium_port = 4000 end config = Webrat.configuration config.should_not open_error_files - config.selenium_environment.should == :test - config.selenium_port.should == 4000 end [:rails,