class WatirSpec::Implementation

Attributes

browser_args[RW]
browser_class[W]
driver_info[RW]
guard_proc[W]
name[W]

Public Class Methods

new() click to toggle source
# File lib/watirspec/implementation.rb, line 6
def initialize
  @guard_proc = nil
end

Public Instance Methods

browser_class() click to toggle source
# File lib/watirspec/implementation.rb, line 14
def browser_class
  @browser_class || raise('browser_class not set')
end
initialize_copy(_orig) click to toggle source
# File lib/watirspec/implementation.rb, line 10
def initialize_copy(_orig)
  @browser_args = browser_args.map(&:dup)
end
inspect_args() click to toggle source
# File lib/watirspec/implementation.rb, line 35
def inspect_args
  hash = browser_args.last
  desired_capabilities = hash.delete(:desired_capabilities)
  string = ''
  hash.each { |arg| string << "#{arg.inspect}\n" }
  return "#{string} default capabilities" unless desired_capabilities

  string << "\tcapabilities:\n"
  caps.each { |k, v| string << "\t\t#{k}: #{v}\n" }
  hash[:desired_capabilities] = desired_capabilities
  string
end
matches_guard?(args) click to toggle source
# File lib/watirspec/implementation.rb, line 22
def matches_guard?(args)
  return @guard_proc.call(args) if @guard_proc

  args.include? name
end
matching_guards_in(guards) click to toggle source
# File lib/watirspec/implementation.rb, line 28
def matching_guards_in(guards)
  result = []
  guards.each { |args, data| data.each { |d| result << d } if args.empty? || matches_guard?(args) }

  result
end
name() click to toggle source
# File lib/watirspec/implementation.rb, line 18
def name
  @name || raise('implementation name not set')
end