我想存根对象A以使用参数1响应下一个消息并返回“B”字符串。
describe "some situation" do
before do
A = double("Some Object")
A.stub(:next).with(1).and_return("B")
end
it "passes" do
expect(A.next(1)).to eq(B)
end
end
我想A.stub(:next).with(1).and_return("B")
用新的 rspec 语法写一行,A.allow...
但我找不到在哪里添加该with
部分