Class: HaveAttributesMatcher::HaveOneWithAttributes

Inherits:
HaveAttributes show all
Defined in:
lib/have_attributes.rb

Instance Method Summary collapse

Methods inherited from HaveAttributes

#differ, #initialize

Constructor Details

This class inherits a constructor from HaveAttributesMatcher::HaveAttributes

Instance Method Details

#failure_messageObject



48
49
50
# File 'lib/have_attributes.rb', line 48

def failure_message
  "expected to have one record with attributes #{@expected.inspect}"
end

#matches?(target) ⇒ Boolean

Returns:

  • (Boolean)


42
43
44
45
46
# File 'lib/have_attributes.rb', line 42

def matches?(target)
  target.any? do |record|
    super(record)
  end
end