Class: Accessibility::AbstractMatcher Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/expectations/ax_elements.rb

Overview

This class is abstract.

Base class for RSpec matchers used with AXElements.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kind, filters) { ... } ⇒ AbstractMatcher

Returns a new instance of AbstractMatcher.

Parameters:

  • kind (#to_s)
  • filters (Hash)

Yields:

  • Optional block used for search filtering



25
26
27
# File 'lib/rspec/expectations/ax_elements.rb', line 25

def initialize kind, filters, &block
  @kind, @filters, @block = kind, filters, block
end

Instance Attribute Details

#blockProc (readonly)

Returns:

  • (Proc)


20
21
22
# File 'lib/rspec/expectations/ax_elements.rb', line 20

def block
  @block
end

#filtersHash{Symbol=>Object} (readonly)

Returns:

  • (Hash{Symbol=>Object})


17
18
19
# File 'lib/rspec/expectations/ax_elements.rb', line 17

def filters
  @filters
end

#kind#to_s (readonly)

Returns:

  • (#to_s)


14
15
16
# File 'lib/rspec/expectations/ax_elements.rb', line 14

def kind
  @kind
end

Instance Method Details

#does_not_match?(element) ⇒ Boolean

Parameters:

  • element (AX::Element)

Returns:

  • (Boolean)


30
31
32
# File 'lib/rspec/expectations/ax_elements.rb', line 30

def does_not_match? element
  !matches?(element)
end