Class: RSpec::Mocks::ArgumentMatchers::ArrayIncludingMatcher Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Inherits: | Object |
Defined in: | rspec-mocks/lib/rspec/mocks/argument_matchers.rb |
Class Method Summary
- .new(expected) ⇒ ArrayIncludingMatcher constructor Internal use only
Instance Method Summary
- #===(actual) Internal use only
- #description Internal use only
- #formatted_expected_values private Internal use only
Instance Method Details
#===(actual)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/argument_matchers.rb', line 247
def ===(actual) actual = actual.uniq return true if (actual & @expected).count >= @expected.count @expected.uniq.all? do |expected_element| actual.any? do |actual_element| RSpec::Support::FuzzyMatcher.values_match?(expected_element, actual_element) end end rescue NoMethodError false end
#description
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/argument_matchers.rb', line 260
def description "array_including(#{formatted_expected_values})" end
#formatted_expected_values (private)
[ GitHub ]# File 'rspec-mocks/lib/rspec/mocks/argument_matchers.rb', line 266
def formatted_expected_values @expected.map do |x| RSpec::Support.rspec_description_for_object(x) end.join(", ") end