Hi,
I have a lambda.
Test = lambda { kill(333) }
How should I spec if I want to make sure this Test will send kill message with
333? Thanks.
Best regards,
Zhi-Qiang Lei
zhiqiang@gmail.com
___
rspec-users mailing list
rspec-users@rubyforge.org
ht
On Sun, Dec 26, 2010 at 12:05 AM, Zhi-Qiang Lei wrote:
> Hi,
>
> I have a lambda.
>
> Test = lambda { kill(333) }
>
> How should I spec if I want to make sure this Test will send kill message
> with 333? Thanks.
Depends on the scope in which the block will be evaluated. Since kill
is being calle
Sorry, it is my codes' fault. It works now.
On Dec 26, 2010, at 3:47 PM, Zhi-Qiang Lei wrote:
> Hi,
>
> I'm trying to mock the scope.
>
> Test = lambda { kill(333) }
> app = double("test")
> app.should_receive(:kill).with(333).once
> app.instance_eval Test
>
> It will say that kill method miss
Hi,
I'm trying to mock the scope.
Test = lambda { kill(333) }
app = double("test")
app.should_receive(:kill).with(333).once
app.instance_eval Test
It will say that kill method miss in app. And to stub a kill method will not
help. Can I only define a new class to test it? Thanks.
On Dec 26, 201