Object
# File lib/rspec/matchers/built_in/match_array.rb, line 30 30: def description 31: "contain exactly #{_pretty_print(@expected)}" 32: end
# File lib/rspec/matchers/built_in/match_array.rb, line 18 18: def failure_message_for_should 19: message = "expected collection contained: #{safe_sort(@expected).inspect}\n" 20: message += "actual collection contained: #{safe_sort(@actual).inspect}\n" 21: message += "the missing elements were: #{safe_sort(@missing_items).inspect}\n" unless @missing_items.empty? 22: message += "the extra elements were: #{safe_sort(@extra_items).inspect}\n" unless @extra_items.empty? 23: message 24: end
# File lib/rspec/matchers/built_in/match_array.rb, line 26 26: def failure_message_for_should_not 27: "Matcher does not support should_not" 28: end
# File lib/rspec/matchers/built_in/match_array.rb, line 11 11: def matches?(actual) 12: @actual = actual 13: @extra_items = difference_between_arrays(@actual, @expected) 14: @missing_items = difference_between_arrays(@expected, @actual) 15: @extra_items.empty? & @missing_items.empty? 16: end
# File lib/rspec/matchers/built_in/match_array.rb, line 40 40: def difference_between_arrays(array_1, array_2) 41: difference = array_1.dup 42: array_2.each do |element| 43: if index = difference.index(element) 44: difference.delete_at(index) 45: end 46: end 47: difference 48: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.