Skip to content

Commit

Permalink
Revert "Fixing category page 404 error due to exception message being…
Browse files Browse the repository at this point in the history
… passed as nil" (#547)

Revert "Fixing category page 404 error due to exception message being passed …"

This reverts commit 4eb00e3.
  • Loading branch information
andrcuns authored Apr 19, 2024
1 parent a3cfd1e commit 60dd338
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion allure-rspec/spec/unit/formatter_example_finished_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions allure-ruby-commons/spec/unit/result_utils_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 60dd338

Please sign in to comment.