Sha256: b5dba1b4d3e9ef9958d2949f597dee04eb60d576e080ac04023002703bcf2f47
Contents?: true
Size: 467 Bytes
Versions: 9
Compression:
Stored size: 467 Bytes
Contents
RSpec::Matchers.define :match_attributes do |expected| match do |actual| success = true expected.each_pair do |key,value| # check if its a boolean success = if !!actual.send(key) == actual.send(key) actual.send(key) == (value != 0) elsif actual.send(key).is_a?(Time) actual.send(key).utc.to_i == value.utc.to_i else actual.send(key) == value end break unless success end success end end
Version data entries
9 entries across 9 versions & 1 rubygems