【发布时间】:2012-10-24 15:40:33
【问题描述】:
我有这样的东西:
class Something
def some_method
%x{xyz}
end
end
在规范中:
describe Something do
describe "#some_method" do
it "should execute xyz command in a subshell" do
x = Something.new
#What should come here?
x.some_method
end
end
end
我知道如何模拟“系统”。但我的问题是特定于 "%x" 的。那么如何模拟 %x 呢?
【问题讨论】:
-
@theTinMan ,什么都没有。在这种情况下,我没有对返回值做任何事情。
标签: ruby unit-testing rspec mocking tdd