Class: RSpec::Mocks::ArgumentMatchers::ArrayIncludingMatcher
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-mocks-3.12.2/lib/rspec/mocks/argument_matchers.rb
Instance Method Summary collapse
- #===(actual) ⇒ Object
- #description ⇒ Object
-
#initialize(expected) ⇒ ArrayIncludingMatcher
constructor
A new instance of ArrayIncludingMatcher.
Constructor Details
#initialize(expected) ⇒ ArrayIncludingMatcher
Returns a new instance of ArrayIncludingMatcher.
233 234 235 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-mocks-3.12.2/lib/rspec/mocks/argument_matchers.rb', line 233 def initialize(expected) @expected = expected end |
Instance Method Details
#===(actual) ⇒ Object
237 238 239 240 241 242 243 244 245 246 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-mocks-3.12.2/lib/rspec/mocks/argument_matchers.rb', line 237 def ===(actual) actual = actual.uniq @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 ⇒ Object
248 249 250 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-mocks-3.12.2/lib/rspec/mocks/argument_matchers.rb', line 248 def description "array_including(#{formatted_expected_values})" end |