features/support/message_table_matcher.rb in message-driver-0.3.0 vs features/support/message_table_matcher.rb in message-driver-0.4.0

- old
+ new

@@ -2,13 +2,12 @@ define_method :expected_hash do @expected_hash ||= expected_tbl.hashes end define_method :messages_to_hash do |messages| - messages.collect do |msg| - expected_tbl.headers.inject({ }) do |memo, obj| - memo[obj] = msg.send(obj) - memo + messages.map do |msg| + expected_tbl.headers.each_with_object({}) do |method, hash| + hash[method] = msg.send(method) end end end match do |messages|