mirror of
https://gitea.invidious.io/iv-org/shard-spectator.git
synced 2024-08-15 00:53:35 +00:00
Change back to passing text as argument
This commit is contained in:
parent
1610d6ebe3
commit
80150f945b
1 changed files with 6 additions and 7 deletions
|
@ -43,7 +43,7 @@ module Spectator::Formatters
|
||||||
# 1) Example name
|
# 1) Example name
|
||||||
# ```
|
# ```
|
||||||
private def title(io)
|
private def title(io)
|
||||||
line(io) { io << NumberedItem.new(@index, @result.example) }
|
line(io, NumberedItem.new(@index, @result.example))
|
||||||
end
|
end
|
||||||
|
|
||||||
# Produces the message line of the failure block.
|
# Produces the message line of the failure block.
|
||||||
|
@ -54,7 +54,7 @@ module Spectator::Formatters
|
||||||
# The indentation of this line starts directly under
|
# The indentation of this line starts directly under
|
||||||
# the example name from the title line.
|
# the example name from the title line.
|
||||||
private def message(io)
|
private def message(io)
|
||||||
line(io) { io << FailureMessage.color(@result) }
|
line(io, FailureMessage.color(@result))
|
||||||
end
|
end
|
||||||
|
|
||||||
# Produces the values list of the failure block.
|
# Produces the values list of the failure block.
|
||||||
|
@ -63,7 +63,7 @@ module Spectator::Formatters
|
||||||
indent do
|
indent do
|
||||||
@result.expectations.each_unsatisfied do |expectation|
|
@result.expectations.each_unsatisfied do |expectation|
|
||||||
expectation.values.each do |key, value|
|
expectation.values.each do |key, value|
|
||||||
line(io) { io << MatchDataValuePair.new(key, value) }
|
line(io, MatchDataValuePair.new(key, value))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -72,7 +72,7 @@ module Spectator::Formatters
|
||||||
|
|
||||||
# Produces the source line of the failure block.
|
# Produces the source line of the failure block.
|
||||||
private def source(io)
|
private def source(io)
|
||||||
line(io) { io << Comment.color(@result.example.source) }
|
line(io, Comment.color(@result.example.source))
|
||||||
end
|
end
|
||||||
|
|
||||||
# Increases the indentation for a block of text.
|
# Increases the indentation for a block of text.
|
||||||
|
@ -84,10 +84,9 @@ module Spectator::Formatters
|
||||||
end
|
end
|
||||||
|
|
||||||
# Produces a line of text with a leading indent.
|
# Produces a line of text with a leading indent.
|
||||||
private def line(io)
|
private def line(io, text)
|
||||||
@indent.times { io << ' ' }
|
@indent.times { io << ' ' }
|
||||||
yield
|
io.puts text
|
||||||
io.puts
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Gets the number of characters a positive integer spans in base 10.
|
# Gets the number of characters a positive integer spans in base 10.
|
||||||
|
|
Loading…
Reference in a new issue