Module: WatirSpec

Defined in:
lib/watirspec.rb,
lib/watirspec/guards.rb,
lib/watirspec/runner.rb,
lib/watirspec/server.rb,
lib/watirspec/rake_tasks.rb,
lib/watirspec/server/app.rb,
lib/watirspec/remote_server.rb,
lib/watirspec/implementation.rb

Defined Under Namespace

Modules: Guards, Runner Classes: Implementation, RakeTasks, RemoteServer, Server

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.browser_argsObject

Returns the value of attribute browser_args



9
10
11
# File 'lib/watirspec.rb', line 9

def browser_args
  @browser_args
end

.implementationObject

Returns the value of attribute implementation



9
10
11
# File 'lib/watirspec.rb', line 9

def implementation
  @implementation
end

.unguardedObject

Returns the value of attribute unguarded



9
10
11
# File 'lib/watirspec.rb', line 9

def unguarded
  @unguarded
end

Class Method Details

.hostObject



24
25
26
# File 'lib/watirspec.rb', line 24

def host
  @host ||= "http://#{Server.bind}:#{Server.port}"
end

.htmlObject



11
12
13
# File 'lib/watirspec.rb', line 11

def html
  @html ||= File.expand_path("../../spec/watirspec/html", __FILE__)
end

.load_supportObject



32
33
34
35
36
37
# File 'lib/watirspec.rb', line 32

def load_support
  root = File.expand_path("../../spec/watirspec", __FILE__)
  Dir.glob("#{root}/support/**/*.rb").each do |file|
    require file
  end
end

.new_browserObject



56
57
58
59
60
61
62
63
64
# File 'lib/watirspec.rb', line 56

def new_browser
  klass = WatirSpec.implementation.browser_class
  args = Array(WatirSpec.implementation.browser_args).map { |e| Hash === e ? e.dup : e }

  instance = klass.new(*args)
  print_browser_info_once(instance)

  instance
end

.run!Object



15
16
17
18
# File 'lib/watirspec.rb', line 15

def run!
  load_support
  WatirSpec::Runner.execute_if_necessary
end

.unguarded?Boolean



28
29
30
# File 'lib/watirspec.rb', line 28

def unguarded?
  @unguarded ||= false
end

.url_for(str) ⇒ Object



20
21
22
# File 'lib/watirspec.rb', line 20

def url_for(str)
  File.join(host, str)
end