【发布时间】:2013-09-20 01:44:32
【问题描述】:
目前我正在构建的有以下两行我想为其创建单元测试:
system @command.join(' ')
exit $?.exitstatus
现在我知道我可以这样做:
Kernel.should_receive(:system).with()
Kernel.should_receive(:exit).with(0)
但是,当 gem 调用 $?.exitstatus 时,我无法模拟/存根。
有人知道怎么做吗?
【问题讨论】: