File tree Expand file tree Collapse file tree
sentry-ruby/spec/sentry/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,9 +43,9 @@ def error(*); raise IOError, "oops"; end
4343 def debug ( *) ; raise IOError , "oops" ; end
4444 def warn ( *) ; raise IOError , "oops" ; end
4545 end . new
46-
46+
4747 helper = helper_class . new ( broken_logger )
48-
48+
4949 expect ( $stderr) . to receive ( :puts ) . with ( /Sentry SDK logging failed \( IOError: / )
5050 expect { helper . public_send ( method_name , *args ) } . not_to raise_error
5151 end
@@ -82,18 +82,18 @@ def initialize(*)
8282 end
8383 end . new ( StringIO . new )
8484 end
85-
85+
8686 let ( :logger_helper ) { helper_class . new ( json_logger ) }
8787
8888 it "falls back to stderr when JSON encoding fails on invalid UTF-8" do
8989 exception = StandardError . new ( "Error \x92 " . dup . force_encoding ( "UTF-8" ) )
90-
90+
9191 # Capture the stderr message
9292 stderr_message = nil
9393 expect ( $stderr) . to receive ( :puts ) { |msg | stderr_message = msg }
94-
94+
9595 expect { logger_helper . log_error ( "Event sending failed" , exception ) } . not_to raise_error
96-
96+
9797 # Verify the error message contains the key information
9898 expect ( stderr_message ) . to include ( "Sentry SDK logging failed" )
9999 expect ( stderr_message ) . to include ( "JSON::GeneratorError" )
You canāt perform that action at this time.
0 commit comments