mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Name is optional for doubles
This commit is contained in:
parent
a63d3d05a5
commit
1a3f663b70
1 changed files with 3 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
|||
require "../mocks"
|
||||
|
||||
module Spectator::DSL
|
||||
macro double(name, **stubs, &block)
|
||||
macro double(name = "Anonymous", **stubs, &block)
|
||||
{% if name.is_a?(StringLiteral) %}
|
||||
anonymous_double({{name}}, {{stubs.double_splat}})
|
||||
{% else %}
|
||||
|
@ -44,7 +44,7 @@ module Spectator::DSL
|
|||
end
|
||||
end
|
||||
|
||||
def anonymous_double(name : String, **stubs)
|
||||
def anonymous_double(name = "Anonymous", **stubs)
|
||||
Mocks::AnonymousDouble.new(name, stubs)
|
||||
end
|
||||
|
||||
|
@ -91,7 +91,7 @@ module Spectator::DSL
|
|||
end
|
||||
end
|
||||
|
||||
def anonymous_null_double(name : String, **stubs)
|
||||
def anonymous_null_double(name = "Anonymous", **stubs)
|
||||
AnonymousNullDouble.new(name, stubs)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue