Class: RSpec::SSE::Matchers::IncludeMatcher
- Inherits:
-
BaseMatcher
- Object
- BaseMatcher
- RSpec::SSE::Matchers::IncludeMatcher
- Defined in:
- lib/rspec/sse/matchers.rb
Overview
Base matcher for inclusion matching (subset)
Direct Known Subclasses
HaveEventData, HaveEventIds, HaveEventTypes, HaveEvents, HaveReconnectionTimes
Instance Method Summary collapse
- #description ⇒ Object
-
#match_condition ⇒ Object
Match if extracted actual values include all expected values.
Methods inherited from BaseMatcher
#failure_message, #failure_message_when_negated, #initialize, #match_arrays, #match_items, #matches?
Constructor Details
This class inherits a constructor from RSpec::SSE::Matchers::BaseMatcher
Instance Method Details
#description ⇒ Object
390 391 392 |
# File 'lib/rspec/sse/matchers.rb', line 390 def description "include #{@expected.inspect}" end |
#match_condition ⇒ Object
Match if extracted actual values include all expected values
383 384 385 386 387 |
# File 'lib/rspec/sse/matchers.rb', line 383 def match_condition @expected.all? do |expected_item| extract_actual.any? { |actual_item| match_items(actual_item, expected_item) } end end |