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"
|
require "../mocks"
|
||||||
|
|
||||||
module Spectator::DSL
|
module Spectator::DSL
|
||||||
macro double(name, **stubs, &block)
|
macro double(name = "Anonymous", **stubs, &block)
|
||||||
{% if name.is_a?(StringLiteral) %}
|
{% if name.is_a?(StringLiteral) %}
|
||||||
anonymous_double({{name}}, {{stubs.double_splat}})
|
anonymous_double({{name}}, {{stubs.double_splat}})
|
||||||
{% else %}
|
{% else %}
|
||||||
|
@ -44,7 +44,7 @@ module Spectator::DSL
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def anonymous_double(name : String, **stubs)
|
def anonymous_double(name = "Anonymous", **stubs)
|
||||||
Mocks::AnonymousDouble.new(name, stubs)
|
Mocks::AnonymousDouble.new(name, stubs)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ module Spectator::DSL
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def anonymous_null_double(name : String, **stubs)
|
def anonymous_null_double(name = "Anonymous", **stubs)
|
||||||
AnonymousNullDouble.new(name, stubs)
|
AnonymousNullDouble.new(name, stubs)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue