mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Mark DSL generated methods as private
This commit is contained in:
parent
7a5f7adfc2
commit
8232da1167
4 changed files with 7 additions and 7 deletions
|
@ -41,7 +41,7 @@ module Spectator::DSL
|
|||
_spectator_tags(%tags, :tags, {{tags.splat(",")}} {{metadata.double_splat}})
|
||||
_spectator_tags(\%tags, %tags, \{{tags.splat(",")}} \{{metadata.double_splat}})
|
||||
|
||||
def \%test(\{{block.args.splat}}) : Nil
|
||||
private def \%test(\{{block.args.splat}}) : Nil
|
||||
\{{block.body}}
|
||||
end
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ module Spectator::DSL
|
|||
\{% raise "Missing block for '{{type.id}}' hook" unless block %}
|
||||
\{% raise "Cannot use '{{type.id}}' inside of a test block" if @def %}
|
||||
|
||||
def self.\%hook : Nil
|
||||
private def self.\%hook : Nil
|
||||
\{{block.body}}
|
||||
end
|
||||
|
||||
|
@ -29,7 +29,7 @@ module Spectator::DSL
|
|||
\{% raise "Block argument count '{{type.id}}' hook must be 0..1" if block.args.size > 1 %}
|
||||
\{% raise "Cannot use '{{type.id}}' inside of a test block" if @def %}
|
||||
|
||||
def \%hook(\{{block.args.splat}}) : Nil
|
||||
private def \%hook(\{{block.args.splat}}) : Nil
|
||||
\{{block.body}}
|
||||
end
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ module Spectator::DSL
|
|||
# returned by *source* with *tags* and *metadata*.
|
||||
# Any falsey items from *metadata* are removed.
|
||||
private macro _spectator_tags(name, source, *tags, **metadata)
|
||||
def self.{{name.id}}
|
||||
private def self.{{name.id}}
|
||||
%tags = {{source.id}}
|
||||
{% unless tags.empty? %}
|
||||
%tags.concat({ {{tags.map(&.id.symbolize).splat}} })
|
||||
|
|
|
@ -14,7 +14,7 @@ module Spectator::DSL
|
|||
|
||||
@%value = ::Spectator::LazyWrapper.new
|
||||
|
||||
def {{name.id}}
|
||||
private def {{name.id}}
|
||||
{% if block.args.size > 0 %}
|
||||
{{block.args.first}} = ::Spectator::Example.current
|
||||
{% end %}
|
||||
|
@ -62,7 +62,7 @@ module Spectator::DSL
|
|||
let({{name.id}}) {{block}}
|
||||
|
||||
{% if name.id != :subject.id %}
|
||||
def subject
|
||||
private def subject
|
||||
{{name.id}}
|
||||
end
|
||||
{% end %}
|
||||
|
@ -93,7 +93,7 @@ module Spectator::DSL
|
|||
let!({{name.id}}) {{block}}
|
||||
|
||||
{% if name.id != :subject.id %}
|
||||
def subject
|
||||
private def subject
|
||||
{{name.id}}
|
||||
end
|
||||
{% end %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue