Use inspect on values in to_s

The to_json method calls to_s, which results in incorrect output.
This commit is contained in:
Michael Miller 2019-04-05 23:13:23 -06:00
parent 53de72805b
commit 9650d7f9c1
5 changed files with 5 additions and 5 deletions

View file

@ -21,7 +21,7 @@ module Spectator::Matchers
# Produces a stringified value.
def to_s(io)
io << value
@value.inspect(io)
end
# Produces a stringified value with additional information.

View file

@ -12,7 +12,7 @@ module Spectator::Matchers
# Stringifies the value.
def to_s(io)
io << @value
@value.inspect(io)
end
# Inspects the value.

View file

@ -21,7 +21,7 @@ module Spectator::Matchers
# The string will be prefixed with "Not" when negated.
def to_s(io)
io << "Not " if @negated
io << @value
@value.inspect(io)
end
# Produces a stringified value with additional information.

View file

@ -26,7 +26,7 @@ module Spectator::Matchers
def to_s(io)
io << prefix
io << ' '
io << @value
@value.inspect(io)
end
# Produces a stringified value with additional information.

View file

@ -14,7 +14,7 @@ module Spectator::Matchers
def to_s(io)
io << @prefix
io << ' '
io << @value
@value.inspect(io)
end
# Outputs details of the formatted value with a prefix.