class RSpec::Matchers::BuiltIn::Include

@api private Provides the implementation for `include`. Not intended to be instantiated directly.

Attributes

expecteds[R]

@private

Public Instance Methods

description() click to toggle source

@api private @return [String]

# File lib/rspec/matchers/built_in/include.rb, line 29
def description
  improve_hash_formatting("include#{readable_list_of(expecteds)}")
end
diffable?() click to toggle source

@api private @return [Boolean]

# File lib/rspec/matchers/built_in/include.rb, line 47
def diffable?
  !diff_would_wrongly_highlight_matched_item?
end
does_not_match?(actual) click to toggle source

@api private @return [Boolean]

# File lib/rspec/matchers/built_in/include.rb, line 23
def does_not_match?(actual)
  perform_match(actual) { |v| !v }
end
expected() click to toggle source

@api private @return [Array, Hash]

# File lib/rspec/matchers/built_in/include.rb, line 53
def expected
  if expecteds.one? && Hash === expecteds.first
    expecteds.first
  else
    expecteds
  end
end
failure_message() click to toggle source

@api private @return [String]

# File lib/rspec/matchers/built_in/include.rb, line 35
def failure_message
  format_failure_message("to") { super }
end
failure_message_when_negated() click to toggle source

@api private @return [String]

# File lib/rspec/matchers/built_in/include.rb, line 41
def failure_message_when_negated
  format_failure_message("not to") { super }
end
matches?(actual) click to toggle source

@api private @return [Boolean]

# File lib/rspec/matchers/built_in/include.rb, line 17
def matches?(actual)
  perform_match(actual) { |v| v }
end

Public Class Methods

new(*expecteds) click to toggle source
# File lib/rspec/matchers/built_in/include.rb, line 11
def initialize(*expecteds)
  @expecteds = expecteds
end