module PropCheck::Property::OutputFormatter
@api private
Public Instance Methods
post_output(output, n_shrink_steps, shrunken_result, shrunken_exception)
click to toggle source
# File lib/prop_check/property/output_formatter.rb, line 19 def post_output(output, n_shrink_steps, shrunken_result, shrunken_exception) if n_shrink_steps == 0 output.puts '(shrinking impossible)' else output.puts '' output.puts "Shrunken input (after #{n_shrink_steps} shrink steps):" output.puts "`#{print_roots(shrunken_result)}`" output.puts "" output.puts "Shrunken exception:\n---\n#{shrunken_exception}" output.puts "---" output.puts "" end output end
pre_output(output, n_successful, generated_root, problem)
click to toggle source
# File lib/prop_check/property/output_formatter.rb, line 6 def pre_output(output, n_successful, generated_root, problem) output.puts "" output.puts "(after #{n_successful} successful property test runs)" output.puts "Failed on: " output.puts "`#{print_roots(generated_root)}`" output.puts "" output.puts "Exception message:\n---\n#{problem}" output.puts "---" output.puts "" output end
print_roots(lazy_tree_val)
click to toggle source
# File lib/prop_check/property/output_formatter.rb, line 34 def print_roots(lazy_tree_val) if lazy_tree_val.is_a?(Array) && lazy_tree_val.length == 1 && lazy_tree_val[0].is_a?(Hash) lazy_tree_val[0].ai else lazy_tree_val.ai end end