Sha256: 8cbafc223a1fce4e12549173c618cb1193b2c91f749c3cb7c8d79ac98d582c39
Contents?: true
Size: 919 Bytes
Versions: 4
Compression:
Stored size: 919 Bytes
Contents
RSpec::Matchers.define :be_same_as do |expected| match do |actual| actual.same_as?(expected) end failure_message_for_should do |actual| #%(#{actual.inspect_without_ignored_attributes} was expected to have the same attributes as\n) + #%(#{expected.inspect_without_ignored_attributes}) attr_names_that_differed = actual.attributes_without_ignored_attributes.select do |k,v| expected[k] != v end.map(&:first) # TODO: pass extra option to inspect_with (such as the other object) so that it can use the same width for each attribute so that they line up nicely and are easy to visually compare %(expected: #{expected.inspect_with(attr_names_that_differed)}\n) + %( got: #{actual.inspect_with(attr_names_that_differed)}) end failure_message_for_should_not do |actual| %( expected: #{expected.inspect}\n) + %(to not be same_as: #{actual.inspect}) end end
Version data entries
4 entries across 4 versions & 1 rubygems