class Selenium::WebDriver::Support::Guards::Guard

def except?

Bug is present on all configurations specified
def except?
  @type == :except
end

def exclude?

Bug is present on all configurations specified, but test can not be run because it breaks other tests
def exclude?
  @type == :exclude
end

def exclusive?

Test only applies to configurations specified
def exclusive?
  @type == :exclusive
end

def initialize(guarded, type, guards = nil)

def initialize(guarded, type, guards = nil)
  @guarded = guarded
  @tracker = guards&.bug_tracker || ''
  @messages = guards&.messages || {}
  @messages[:unknown] = 'TODO: Investigate why this is failing and file a bug report'
  @type = type
  @reason = @guarded.delete(:reason)
end

def message

def message
  details = case @reason
            when Integer
              "Bug Filed: #{@tracker}/#{@reason}"
            when Symbol
              @messages[@reason]
            when String
              @reason
            else
              'no reason given'
            end
  case @type
  when :exclude
    "Test not guarded because it breaks test run; #{details}"
  when :exclusive
    "Test does not apply to this configuration; #{details}"
  else
    "Test guarded; #{details}"
  end
end

def only?

Bug is present on all configurations not specified
def only?
  @type == :only
end