Sha256: b4b863869fd9ebf3535f0491b42031e237087ed262fc99105588d1453b0da25a

Contents?: true

Size: 1.21 KB

Versions: 9

Compression:

Stored size: 1.21 KB

Contents

require "webrat/selenium/application_servers/base"

module Webrat
  module Selenium
    module ApplicationServers
      class Rails < Webrat::Selenium::ApplicationServers::Base

        def start
          system start_command
        end

        def stop
          silence_stream(STDOUT) do
            system stop_command
          end
        end

        def fail
          $stderr.puts
          $stderr.puts
          $stderr.puts "==> Failed to boot the Rails application server... exiting!"
          $stderr.puts
          $stderr.puts "Verify you can start a Rails server on port #{Webrat.configuration.application_port} with the following command:"
          $stderr.puts
          $stderr.puts "    #{start_command}"
          exit
        end

        def pid_file
          prepare_pid_file("#{::Rails.root}/tmp/pids", "mongrel_selenium.pid")
        end

        def start_command
          "mongrel_rails start -d --chdir='#{::Rails.root}' --port=#{Webrat.configuration.application_port} --environment=#{Webrat.configuration.application_environment} --pid #{pid_file} &"
        end

        def stop_command
          "mongrel_rails stop -c #{::Rails.root} --pid #{pid_file}"
        end

      end
    end
  end
end

Version data entries

9 entries across 9 versions & 5 rubygems

Version Path
radiant-1.0.0 ruby-debug/ruby/1.8/gems/webrat-0.7.3/lib/webrat/selenium/application_servers/rails.rb
indirect-webrat-0.7.5 lib/webrat/selenium/application_servers/rails.rb
indirect-webrat-0.7.4 lib/webrat/selenium/application_servers/rails.rb
webrat-0.7.3 lib/webrat/selenium/application_servers/rails.rb
jbd-webrat-0.7.2.rails3 lib/webrat/selenium/application_servers/rails.rb
webrat-0.7.2 lib/webrat/selenium/application_servers/rails.rb
webrat-0.7.2.beta.2 lib/webrat/selenium/application_servers/rails.rb
mutle-webrat-0.7.2.beta.1 lib/webrat/selenium/application_servers/rails.rb
webrat-0.7.2.beta.1 lib/webrat/selenium/application_servers/rails.rb