class Adequack::RspecProxy
Public Instance Methods
receive(method_name, &block)
click to toggle source
# File lib/adequack/integration/rspec_proxy.rb, line 30 def receive(method_name, &block) binding.pry check_method_existence method_name target.receive method_name, &block end
should_receive(message, opts = {}, &block)
click to toggle source
# File lib/adequack/integration/rspec_proxy.rb, line 24 def should_receive(message, opts = {}, &block) check_method_existence message target.should_receive(message, opts, &block) end
stub(message_or_hash, opts = {}, &block)
click to toggle source
# File lib/adequack/integration/rspec_proxy.rb, line 4 def stub(message_or_hash, opts = {}, &block) methods = Hash === message_or_hash ? message_or_hash.keys : [message_or_hash] methods.each { |m| check_method_existence m } target.stub(message_or_hash, opts, &block) end
Also aliased as: stub!
stub_chain(*chain, &blk)
click to toggle source
# File lib/adequack/integration/rspec_proxy.rb, line 15 def stub_chain(*chain, &blk) method = String === chain.first ? chain.first.split(".").first : chain.first check_method_existence method target.stub_chain(*chain, &blk) end