[rspec-users] spec'ing out a trap/SIGINT - BUG?

Scott Taylor mailing_lists at railsnewbie.com
Fri Apr 13 00:50:42 EDT 2007


is this a bug?

   it "should call trap" do
     blk = lambda { raise Interrupt }
     @a.should_receive(:trap).with("INT", blk)
     @a.add_sigint_handler
   end


the corresponding_method:
def add_sigint_handler
     trap("INT") do
       raise Interrupt
     end
end


the output of the spec:

Spec::Mocks::MockExpectationError in 'Ctrl-C/SIGINT handler -  should  
call trap'
#<Autospec:0x1118dec> expected :trap with ("INT", #<Proc:0x0107f070 at ./ 
spec/autospec_spec.rb:253>) but received it with ("INT")
.

I'm using rspec 0.9 beta 1 in gems

Scott





On Apr 13, 2007, at 12:22 AM, Scott Taylor wrote:

>
> How would you spec out a call to Signal.trap (a ^C or a unix SIGINT)?
>
> Scott
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users



More information about the rspec-users mailing list