shard-spectator/spec/docs/anonymous_doubles_spec.cr
2022-07-14 13:51:24 -06:00

15 lines
369 B
Crystal

require "../spec_helper"
# https://gitlab.com/arctic-fox/spectator/-/wikis/Anonymous-Doubles
Spectator.describe "Anonymous Doubles Docs" do
it "does something" do
dbl = double(foo: 42)
expect(dbl.foo).to eq(42)
end
it "does something" do
dbl = double(foo: 42)
allow(dbl).to receive(:foo).and_return(123)
expect(dbl.foo).to eq(123)
end
end