FIX: an exception cause is itself an exception

FIX: an exception cause is itself an exception

diff --git a/lib/turbo_tests.rb b/lib/turbo_tests.rb
index b3715ae..8e3b5cc 100644
--- a/lib/turbo_tests.rb
+++ b/lib/turbo_tests.rb
@@ -22,7 +22,7 @@ module TurboTests
         new(
           obj[:backtrace],
           obj[:message],
-          obj[:cause]
+          FakeException.from_obj(obj[:cause])
         )
       end
     end
diff --git a/lib/turbo_tests/json_rows_formatter.rb b/lib/turbo_tests/json_rows_formatter.rb
index 2ec66d0..6a9ca69 100644
--- a/lib/turbo_tests/json_rows_formatter.rb
+++ b/lib/turbo_tests/json_rows_formatter.rb
@@ -23,7 +23,7 @@ module TurboTests
         {
           backtrace: exception.backtrace,
           message: exception.message,
-          cause: exception.cause
+          cause: exception_to_json(exception.cause)
         }
       end
     end

GitHub sha: e58f67a0

1 Like