mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Simplify macro eval by returning a lazy double
This commit is contained in:
parent
914def05e1
commit
c1195ef687
2 changed files with 6 additions and 1 deletions
|
@ -56,5 +56,10 @@ Spectator.describe "Lazy double DSL" do
|
|||
dbl = double
|
||||
expect { dbl.oops }.to raise_error(Spectator::UnexpectedMessage, /anonymous/i)
|
||||
end
|
||||
|
||||
it "accepts no name and predefined responses" do
|
||||
dbl = double(foo: 42)
|
||||
expect(dbl.foo).to eq(42)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -125,7 +125,7 @@ module Spectator::DSL
|
|||
# expect(dbl.foo).to eq(42)
|
||||
# ```
|
||||
macro double(**value_methods)
|
||||
new_double({{**value_methods}})
|
||||
::Spectator::LazyDouble.new({{**value_methods}})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue