class MotionSpec::Matcher::HaveItems

Public Class Methods

new(number_of_items) click to toggle source
# File lib/motion-spec/matcher/have_items.rb, line 4
def initialize(number_of_items)
  @number_of_items = number_of_items
end

Public Instance Methods

fail!(subject, negated) click to toggle source
# File lib/motion-spec/matcher/have_items.rb, line 19
def fail!(subject, negated)
  fail FailedExpectation.new(
    FailMessageRenderer.message_for_have_items(
      negated, subject, @number_of_items, subject.size, @key_type_name
    )
  )
end
matches?(value) click to toggle source
# File lib/motion-spec/matcher/have_items.rb, line 8
def matches?(value)
  value.size == @number_of_items
end