-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7c73884
commit c8fbd84
Showing
3 changed files
with
40 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
require "../formatters/printer" | ||
|
||
module Spectator::Matchers | ||
module Formatting | ||
private def description_of(value) | ||
# TODO: Actually format the value. | ||
value.inspect | ||
end | ||
|
||
private def format_description_of(io : IO, value) : Nil | ||
value.inspect(io) | ||
private def format_description_of(printer : Formatters::Printer, value) : Nil | ||
printer.print_value do |io| | ||
value.inspect(io) | ||
end | ||
end | ||
|
||
private def format_description_of(printer : Formatters::Printer, value : T.class) : Nil forall T | ||
printer.print_type do |io| | ||
value.inspect(io) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters