From: David Palm Date: 2009-07-07T02:24:38+09:00 Subject: Re: How to test %x[] calls? On Tue, 7 Jul 2009 00:26:05 +0900, Brian Candler wrote: > ... or inside your own object, it's that object which is the receiver > (which is ultimately subclassed from Object, which mixes in Kernel) > > $ cat zog.rb > class Foo > def boing(x) > puts "boing #{x.inspect}" > end > alias :"`" :boing > > def bar > %x{hello} > end > end > > Foo.new.bar > $ ruby zog.rb > boing "hello" > > So I think you should be able to set the expectation on your own object > - as long as you can do that for private methods. Totally works! You rock! :)