File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 3636 aggregate_failures "Should update correct test case parameters" do
3737 expect ( @test_case . stage ) . to eq ( Allure ::Stage ::FINISHED )
3838 expect ( @test_case . status ) . to eq ( Allure ::Status ::PASSED )
39- expect ( @test_case . status_details ) . to eq ( Allure ::StatusDetails . new )
39+ expect ( @test_case . status_details ) . to eq ( Allure ::StatusDetails . new ( message : "NilClass" ) )
4040 end
4141 end
4242 end
Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ def status(exception)
159159 # @param [Exception] exception
160160 # @return [Allure::StatusDetails]
161161 def status_details ( exception )
162- StatusDetails . new ( message : exception &.message , trace : exception &.backtrace &.join ( "\n " ) )
162+ StatusDetails . new ( message : exception &.message || exception . class . name , trace : exception &.backtrace &.join ( "\n " ) )
163163 end
164164
165165 # Allure attachment object
Original file line number Diff line number Diff line change @@ -93,4 +93,10 @@ def raise_multi_error
9393 expect ( status_details . message ) . to include ( "Got 2 failures from failure aggregation block" )
9494 expect ( status_details . trace ) . not_to be_empty
9595 end
96+
97+ it "returns status details for nill class error" do
98+ status_details = Allure ::ResultUtils . status_details ( nil )
99+ expect ( status_details . message ) . to eq ( "NilClass" )
100+ expect ( status_details . instance_variable_defined? ( :@trace ) ) . to be_truthy
101+ end
96102end
You can’t perform that action at this time.
0 commit comments