Class: TestError
Instance Attribute Summary collapse
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#step ⇒ Object
readonly
Returns the value of attribute step.
Attributes inherited from TestTrace
#file, #line, #line_in_method, #method, #path
Instance Method Summary collapse
-
#initialize(test_case, message, backtrace, step: nil) ⇒ TestError
constructor
Public: Initializes a new Error.
-
#to_s ⇒ Object
Public: Gets string representation of error.
Methods inherited from TestTrace
Methods included from TmcHelpers
#aws_config, #aws_create_s3_bucket, #aws_delete_s3, #aws_delete_s3_bucket, #aws_read_s3, #aws_upload_s3, #aws_write_s3, #get_clean_ocr_text, #get_readable_size, #get_readable_time, #get_string_similarity, #get_substring_similarity, #is_rating?, #is_year?, #jsonify, #pick_random, #rubify, #send_webex_alert, #to_camel_case, #to_pascal_case, #to_snake_case, #twb_case_exists?, #twb_get_case_instance_id, #twb_get_suite_instance_id, #twb_post_screenshot, #twb_post_screenshot!, #twb_post_suite, #twb_post_testcase, #twb_post_teststep, #twb_post_teststep!, #twb_prep_s3_screenshot, #twb_suite_exists?, #until_condition, #until_equals, #until_includes, #until_not_empty, #until_not_equals, #until_not_includes, #until_not_nil, #until_same, #web_delete, #web_get, #web_post, #web_put
Methods included from HttpHelper
Methods included from CsvHelper
Methods included from SshHelper
Methods included from EmailHelper
#send_email, #send_email_setup
Methods included from SnmpHelper
Constructor Details
#initialize(test_case, message, backtrace, step: nil) ⇒ TestError
Public: Initializes a new Error.
test_case - TestCase instance in which the error occurred. message - String error message. backtrace - Array containing error backtrace. step - TestStep in which error occurred (default: nil).
Returns new Error instance.
15 16 17 18 19 20 |
# File 'lib/test_case/test_error.rb', line 15 def initialize(test_case, , backtrace, step: nil) super(test_case, backtrace) @message = @step = step @hash.update(message: @message, step_id: @step.nil? ? nil : @step.id, step_name: @step.nil? ? nil : @step.name) end |
Instance Attribute Details
#message ⇒ Object (readonly)
Returns the value of attribute message.
5 6 7 |
# File 'lib/test_case/test_error.rb', line 5 def @message end |
#step ⇒ Object (readonly)
Returns the value of attribute step.
5 6 7 |
# File 'lib/test_case/test_error.rb', line 5 def step @step end |
Instance Method Details
#to_s ⇒ Object
Public: Gets string representation of error.
Returns error String.
25 26 27 28 |
# File 'lib/test_case/test_error.rb', line 25 def to_s error_hash = {file: @file, line: @line, method: @method, line_in_method: @line_in_method} "#<Error #{error_hash.map {|k, v| "#{k}=#{v}"}.join(', ')}>" end |