From 60dd33822a4936c100354099ac946dec84be6f0c Mon Sep 17 00:00:00 2001 From: Andrejs Date: Fri, 19 Apr 2024 16:45:05 +0300 Subject: [PATCH] Revert "Fixing category page 404 error due to exception message being passed as nil" (#547) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Revert "Fixing category page 404 error due to exception message being passed …" This reverts commit 4eb00e39777b365b0cc72d282b8b6e27e7053014. --- allure-rspec/spec/unit/formatter_example_finished_spec.rb | 2 +- allure-ruby-commons/lib/allure_ruby_commons/result_utils.rb | 2 +- allure-ruby-commons/spec/unit/result_utils_spec.rb | 6 ------ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/allure-rspec/spec/unit/formatter_example_finished_spec.rb b/allure-rspec/spec/unit/formatter_example_finished_spec.rb index bfe2eaa6..cf531311 100644 --- a/allure-rspec/spec/unit/formatter_example_finished_spec.rb +++ b/allure-rspec/spec/unit/formatter_example_finished_spec.rb @@ -36,7 +36,7 @@ aggregate_failures "Should update correct test case parameters" do expect(@test_case.stage).to eq(Allure::Stage::FINISHED) expect(@test_case.status).to eq(Allure::Status::PASSED) - expect(@test_case.status_details).to eq(Allure::StatusDetails.new(message: "NilClass")) + expect(@test_case.status_details).to eq(Allure::StatusDetails.new) end end end diff --git a/allure-ruby-commons/lib/allure_ruby_commons/result_utils.rb b/allure-ruby-commons/lib/allure_ruby_commons/result_utils.rb index fee8c19d..be9dc961 100644 --- a/allure-ruby-commons/lib/allure_ruby_commons/result_utils.rb +++ b/allure-ruby-commons/lib/allure_ruby_commons/result_utils.rb @@ -159,7 +159,7 @@ def status(exception) # @param [Exception] exception # @return [Allure::StatusDetails] def status_details(exception) - StatusDetails.new(message: exception&.message || exception.class.name, trace: exception&.backtrace&.join("\n")) + StatusDetails.new(message: exception&.message, trace: exception&.backtrace&.join("\n")) end # Allure attachment object diff --git a/allure-ruby-commons/spec/unit/result_utils_spec.rb b/allure-ruby-commons/spec/unit/result_utils_spec.rb index 867ca40a..6e8ff807 100644 --- a/allure-ruby-commons/spec/unit/result_utils_spec.rb +++ b/allure-ruby-commons/spec/unit/result_utils_spec.rb @@ -93,10 +93,4 @@ def raise_multi_error expect(status_details.message).to include("Got 2 failures from failure aggregation block") expect(status_details.trace).not_to be_empty end - - it "returns status details for nill class error" do - status_details = Allure::ResultUtils.status_details(nil) - expect(status_details.message).to eq("NilClass") - expect(status_details.instance_variable_defined?(:@trace)).to be_truthy - end end