class Selenium::WebDriver::Support::Guards::GuardCondition
Guard
derived from RSpec example metadata. @api private
Attributes
execution[RW]
name[RW]
Public Class Methods
new(name, condition = nil, &blk)
click to toggle source
# File lib/selenium/webdriver/support/guards/guard_condition.rb, line 33 def initialize(name, condition = nil, &blk) @name = name @execution = if blk proc(&blk) else proc { |guarded| guarded.include?(condition) } end end
Public Instance Methods
satisfied?(guard)
click to toggle source
# File lib/selenium/webdriver/support/guards/guard_condition.rb, line 42 def satisfied?(guard) list = Array(guard.guarded[@name]) list.empty? || @execution.call(list) end