module TestBench::Controls::Error::Text

Public Class Methods

example(message=nil, indentation_depth: nil) click to toggle source
# File lib/test_bench/controls/error.rb, line 7
        def self.example(message=nil, indentation_depth: nil)
          indentation_depth ||= 0

          indent = '  ' * indentation_depth

          error = Error.example(message)

          <<TEXT
#{indent}#{error.backtrace[0]}: #{error.message} (#{error.class.name})
\t#{indent}from #{error.backtrace[1]}
\t#{indent}from #{error.backtrace[2]}
TEXT
        end