Add functionality to clear stubs

This commit is contained in:
Michael Miller 2022-05-15 15:56:32 -06:00
parent fdac99d122
commit c98442e0ed
No known key found for this signature in database
GPG key ID: 32B47AE8F388A1FF
7 changed files with 99 additions and 12 deletions

View file

@ -315,4 +315,15 @@ Spectator.describe Spectator::Double do
end
end
end
describe "#_spectator_clear_stubs" do
subject(dbl) { FooBarDouble.new }
let(stub) { Spectator::ValueStub.new(:foo, 5) }
before_each { dbl._spectator_define_stub(stub) }
it "removes previously defined stubs" do
expect { dbl._spectator_clear_stubs }.to change { dbl.foo }.from(5).to(42)
end
end
end