我有这样的事情:
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 呢?