Skip to content

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
extend/include fun
require './app/app'
module StubbedMessaging
Message = Struct.new(:routing_key, :message, :exchange, :type, :options)
def publish(routing_key, message, exchange = '', type = :direct, options = {})
message = Message.new(routing_key, message, exchange, type, options)
StubbedMessaging.published_messages << message
end
def self.published_messages
@published_messages ||= []
end
end
Messaging::Producer.send(:include, StubbedMessaging)
Arms::Remote::Producer.instance.extend(StubbedMessaging)
p Arms::Remote::Producer.instance.method(:publish).source_location
# => expected
# ["/home/lars/workspace/arms/fun.rb", 6]
# => actual
# ["/home/lars/workspace/arms/lib/messaging/producer.rb", 14]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.