Class: Yadriggy::Assert::Reason
- Inherits:
-
Object
- Object
- Yadriggy::Assert::Reason
- Defined in:
- lib/yadriggy/assert.rb
Overview
Reason that an assertion fails.
Instance Method Summary collapse
-
#ast ⇒ ASTnode
Gets the AST of the block given to assertion.
-
#results ⇒ Hash<ASTnode,Pair<String,Object>>
Gets the detailed results.
-
#show ⇒ Array<String>
Gets the text showing the values of the sub-expressions.
Instance Method Details
#ast ⇒ ASTnode
Gets the AST of the block given to assertion.
63 |
# File 'lib/yadriggy/assert.rb', line 63 def ast() @ast end |
#results ⇒ Hash<ASTnode,Pair<String,Object>>
Gets the detailed results.
69 |
# File 'lib/yadriggy/assert.rb', line 69 def results() @results end |
#show ⇒ Array<String>
Gets the text showing the values of the sub-expressions.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/yadriggy/assert.rb', line 73 def show output = [] header = show2(@ast, '', output) output << header src, value = @results[ast] if src.nil? pp = PrettyPrinter.new(Printer.new(2)) pp.print(ast) output << pp.printer.output else output << src end output.reverse! end |