Class: RSpec::SSE::Matchers::IncludeMatcher

Inherits:
BaseMatcher
  • Object
show all
Defined in:
lib/rspec/sse/matchers.rb

Overview

Base matcher for inclusion matching (subset)

Instance Method Summary collapse

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

#descriptionObject



390
391
392
# File 'lib/rspec/sse/matchers.rb', line 390

def description
  "include #{@expected.inspect}"
end

#match_conditionObject

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