Class: Webrat::Selenium::ApplicationServerFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/webrat/selenium/application_server_factory.rb

Class Method Summary collapse

Class Method Details

.app_server_instanceObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/webrat/selenium/application_server_factory.rb', line 6

def self.app_server_instance
  case Webrat.configuration.application_framework
  when :sinatra
    require "webrat/selenium/application_servers/sinatra"
    return Webrat::Selenium::ApplicationServers::Sinatra.new
  when :merb
    require "webrat/selenium/application_servers/merb"
    return Webrat::Selenium::ApplicationServers::Merb.new
  when :rails
    require "webrat/selenium/application_servers/rails"
    return Webrat::Selenium::ApplicationServers::Rails.new
  when :rack
    require "webrat/selenium/application_servers/rack"
    return Webrat::Selenium::ApplicationServers::Rack.new
  when :external
    require "webrat/selenium/application_servers/external"
    return Webrat::Selenium::ApplicationServers::External.new
  else
    raise WebratError.new(<<-STR)
Unknown Webrat application_framework: #{Webrat.configuration.application_framework.inspect}

Please ensure you have a Webrat configuration block that specifies an application_framework
in your test_helper.rb, spec_helper.rb, or env.rb (for Cucumber).

For example:

  Webrat.configure do |config|
    # ...
    config.application_framework = :rails
  end
STR
  end
end