Replace stub value method with call method

Pass method call information to stub.
This commit is contained in:
Michael Miller 2022-03-31 23:07:55 -06:00
parent f00ea23c47
commit 17592287ad
No known key found for this signature in database
GPG key ID: 32B47AE8F388A1FF
7 changed files with 21 additions and 17 deletions

View file

@ -1,6 +1,7 @@
require "../../spec_helper"
Spectator.describe Spectator::ValueStub do
let(method_call) { Spectator::MethodCall.capture(:foo) }
subject(stub) { Spectator::ValueStub.new(:foo, 42) }
it "stores the method name" do
@ -8,7 +9,7 @@ Spectator.describe Spectator::ValueStub do
end
it "stores the return value" do
expect(stub.value).to eq(42)
expect(stub.call(method_call)).to eq(42)
end
describe "#===" do