[rspec-users] "once" not honored?

rspec-users at kero.tmfweb.nl rspec-users at kero.tmfweb.nl
Sun Feb 3 13:59:54 EST 2008


I'm trying this:

firmware.should_receive(:execute).with("ATZ").once.ordered.and_return(AT_OK)
firmware.should_receive(:execute).with("ATE0V1").once.ordered.and_return(AT_OK)
firmware.should_receive(:execute).with("AT+CNUM").once.and_return(AT_OK)

But rspec does not complain that "AT+CNUM" is never passed as argument.
Bug? Or did I misinterpret the feature "once" ?

NB: I'd love to be able to write firmware.should_receive("AT+CNUM") but
that seems to fail on the way the method :"AT+CNUM" is being defined;
which in turn seems something I can only change (quickly) for Ruby 1.9,
namely blocks not accepting implicit blocks as parameter. Any chance of
fixing that?

Bye,
Kero.




More information about the rspec-users mailing list