clean up constant definitions for rails and fix merb port fubar on selenium appserver stop
This commit is contained in:
parent
9066d2a9cd
commit
7692930769
|
@ -42,7 +42,7 @@ module Webrat
|
||||||
end
|
end
|
||||||
when :merb
|
when :merb
|
||||||
fork do
|
fork do
|
||||||
exec 'merb', '-d'
|
exec 'merb', '-d', '-p', Webrat.configuration.application_port
|
||||||
end
|
end
|
||||||
else # rails
|
else # rails
|
||||||
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} &")
|
||||||
|
@ -57,9 +57,9 @@ module Webrat
|
||||||
system("kill -9 #{pid}")
|
system("kill -9 #{pid}")
|
||||||
FileUtils.rm_f 'rack.pid'
|
FileUtils.rm_f 'rack.pid'
|
||||||
when :merb
|
when :merb
|
||||||
pid = File.read('log/merb.4000.pid')
|
pid = File.read("log/merb.#{Webrat.configuration.application_port}.pid")
|
||||||
system("kill -9 #{pid}")
|
system("kill -9 #{pid}")
|
||||||
FileUtils.rm_f 'log/merb.4000.pid'
|
FileUtils.rm_f "log/merb.#{Webrat.configuration.application_port}.pid"
|
||||||
else # rails
|
else # rails
|
||||||
system "mongrel_rails stop -c #{RAILS_ROOT} --pid #{pid_file}"
|
system "mongrel_rails stop -c #{RAILS_ROOT} --pid #{pid_file}"
|
||||||
end
|
end
|
||||||
|
@ -118,11 +118,12 @@ module Webrat
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if defined?(ActionController::IntegrationTest)
|
||||||
#module ActionController #:nodoc:
|
module ActionController #:nodoc:
|
||||||
# IntegrationTest.class_eval do
|
IntegrationTest.class_eval do
|
||||||
# include Webrat::Methods
|
include Webrat::Methods
|
||||||
# include Webrat::Selenium::Methods
|
include Webrat::Selenium::Methods
|
||||||
# include Webrat::Selenium::Matchers
|
include Webrat::Selenium::Matchers
|
||||||
# end
|
end
|
||||||
#end
|
end
|
||||||
|
end
|
||||||
|
|
|
@ -51,7 +51,7 @@ describe Webrat, "Selenium" do
|
||||||
describe "merb" do
|
describe "merb" do
|
||||||
it "should stop the app server with correct config options" do
|
it "should stop the app server with correct config options" do
|
||||||
Webrat.configuration.application_type = :merb
|
Webrat.configuration.application_type = :merb
|
||||||
File.should_receive(:read).with('log/merb.4000.pid').and_return('666')
|
File.should_receive(:read).with('log/merb.3001.pid').and_return('666')
|
||||||
Webrat.should_receive(:system).with("kill -9 666")
|
Webrat.should_receive(:system).with("kill -9 666")
|
||||||
Webrat.stop_app_server
|
Webrat.stop_app_server
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue