次のメッセージに応答するためにオブジェクト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