Class: DynportTools::HaveAttributesMatcher::HaveOneWithAttributes

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

Instance Method Summary collapse

Methods inherited from HaveAttributes

#differ, #initialize

Constructor Details

This class inherits a constructor from DynportTools::HaveAttributesMatcher::HaveAttributes

Instance Method Details

#failure_messageObject



52
53
54
# File 'lib/dynport_tools/have_attributes.rb', line 52

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

#matches?(target) ⇒ Boolean

Returns:

  • (Boolean)


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

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