mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Rename debug macro
This commit is contained in:
parent
4974054de7
commit
e6d78345c4
3 changed files with 5 additions and 5 deletions
|
@ -10,7 +10,7 @@ module Spectator
|
||||||
|
|
||||||
# Inserts code to produce a debug message.
|
# Inserts code to produce a debug message.
|
||||||
# The code will only be injected when `spectator_debug` is defined (`-Dspectator_debug`).
|
# The code will only be injected when `spectator_debug` is defined (`-Dspectator_debug`).
|
||||||
macro debug_out(message)
|
macro debug(message)
|
||||||
{% if flag?(:spectator_debug) %}
|
{% if flag?(:spectator_debug) %}
|
||||||
STDERR.puts {{message}}
|
STDERR.puts {{message}}
|
||||||
{% end %}
|
{% end %}
|
||||||
|
|
|
@ -28,7 +28,7 @@ module Spectator
|
||||||
# Returns the result of the execution.
|
# Returns the result of the execution.
|
||||||
# The result will also be stored in `#result`.
|
# The result will also be stored in `#result`.
|
||||||
def run : Result
|
def run : Result
|
||||||
Spectator.debug_out("Running example #{self}")
|
Spectator.debug("Running example #{self}")
|
||||||
@delegate.call(self)
|
@delegate.call(self)
|
||||||
raise NotImplementedError.new("#run")
|
raise NotImplementedError.new("#run")
|
||||||
end
|
end
|
||||||
|
|
|
@ -36,7 +36,7 @@ module Spectator
|
||||||
# The newly created group is returned.
|
# The newly created group is returned.
|
||||||
# It shouldn't be used outside of this class until a matching `#end_group` is called.
|
# It shouldn't be used outside of this class until a matching `#end_group` is called.
|
||||||
def start_group(name, source = nil) : ExampleGroup
|
def start_group(name, source = nil) : ExampleGroup
|
||||||
Spectator.debug_out("Start group: #{name.inspect} @ #{source}")
|
Spectator.debug("Start group: #{name.inspect} @ #{source}")
|
||||||
ExampleGroup.new(name, source, current_group).tap do |group|
|
ExampleGroup.new(name, source, current_group).tap do |group|
|
||||||
@group_stack << group
|
@group_stack << group
|
||||||
end
|
end
|
||||||
|
@ -49,7 +49,7 @@ module Spectator
|
||||||
# At this point, it is safe to use the group.
|
# At this point, it is safe to use the group.
|
||||||
# All of its examples and sub-groups have been populated.
|
# All of its examples and sub-groups have been populated.
|
||||||
def end_group : ExampleGroup
|
def end_group : ExampleGroup
|
||||||
Spectator.debug_out("End group: #{current_group}")
|
Spectator.debug("End group: #{current_group}")
|
||||||
raise "Can't pop root group" if root?
|
raise "Can't pop root group" if root?
|
||||||
|
|
||||||
@group_stack.pop
|
@group_stack.pop
|
||||||
|
@ -74,7 +74,7 @@ module Spectator
|
||||||
#
|
#
|
||||||
# The newly created example is returned.
|
# The newly created example is returned.
|
||||||
def add_example(name, source, context, &block : Example, Context ->) : Example
|
def add_example(name, source, context, &block : Example, Context ->) : Example
|
||||||
Spectator.debug_out("Add example: #{name} @ #{source}")
|
Spectator.debug("Add example: #{name} @ #{source}")
|
||||||
delegate = ExampleContextDelegate.new(context, block)
|
delegate = ExampleContextDelegate.new(context, block)
|
||||||
Example.new(delegate, name, source, current_group)
|
Example.new(delegate, name, source, current_group)
|
||||||
# The example is added to the current group by `Example` initializer.
|
# The example is added to the current group by `Example` initializer.
|
||||||
|
|
Loading…
Reference in a new issue