Class: RSpec::Mocks::ArgumentMatchers::ArrayIncludingMatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/mocks/argument_matchers.rb

Instance Method Summary (collapse)

Constructor Details

- (ArrayIncludingMatcher) initialize(expected)



204
205
206
# File 'lib/rspec/mocks/argument_matchers.rb', line 204

def initialize(expected)
  @expected = expected
end

Instance Method Details

- (Object) ===(actual)



208
209
210
# File 'lib/rspec/mocks/argument_matchers.rb', line 208

def ===(actual)
  Set.new(actual).superset?(Set.new(@expected))
end

- (Object) description



212
213
214
# File 'lib/rspec/mocks/argument_matchers.rb', line 212

def description
  "array_including(#{@expected.join(", ")})"
end