Sha256: cdf9dfa7260bffec4b1874e4b764458c069a12a880b4c73300ccb0bc5319c872
Contents?: true
Size: 624 Bytes
Versions: 8
Compression:
Stored size: 624 Bytes
Contents
RSpec::Matchers.define :be_different_array_from do |x| match do |actual| perform_match(actual, expected) @extra + @missing != [] end def perform_match(actual, expected) @extra = actual - expected @missing = expected - actual end failure_message_for_should do |actual| "expected a difference in the two lists, but got none" end failure_message_for_should_not do |actual| "expected no difference, but result #{ [ (@missing.empty? ? nil : 'lacks '+@missing.sort.inspect), (@extra.empty? ? nil : 'has extra '+@extra.sort.inspect) ].compact * ' and ' }" end end
Version data entries
8 entries across 8 versions & 1 rubygems