Class: Accessibility::HasChildShortlyMatcher
Overview
Custom matcher for RSpec to check if an element has the specified
child element within a grace period. Used for testing things
after an asynchronous action is performed.
Instance Attribute Summary
#block, #filters, #kind
Instance Method Summary
collapse
#does_not_match?, #initialize
Instance Method Details
#description ⇒ String
122
123
124
|
# File 'lib/rspec/expectations/ax_elements.rb', line 122
def description
"should have a child that matches #{qualifier.describe} before a timeout occurs"
end
|
#failure_message_for_should ⇒ String
112
113
114
|
# File 'lib/rspec/expectations/ax_elements.rb', line 112
def failure_message_for_should
"Expected #@parent to have child #{qualifier.describe} before a timeout occurred"
end
|
#failure_message_for_should_not ⇒ String
117
118
119
|
# File 'lib/rspec/expectations/ax_elements.rb', line 117
def failure_message_for_should_not
"Expected #@parent to NOT have child #@result before a timeout occurred"
end
|
#matches?(parent) ⇒ Boolean
105
106
107
108
109
|
# File 'lib/rspec/expectations/ax_elements.rb', line 105
def matches? parent
@filters[:parent] = @parent = parent
@result = wait_for kind, filters, &block
!@result.blank?
end
|