From ae203b9a39e8c61b57a119d8c05f49a525976142 Mon Sep 17 00:00:00 2001 From: Sarah Chen Date: Wed, 30 Oct 2024 09:18:16 -0400 Subject: [PATCH] Address PR comments --- Gemfile | 4 ++-- spec/datadog/core/environment/execution_spec.rb | 3 ++- spec/datadog/core/error_spec.rb | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 42cc531546d..9ab9b9c679b 100644 --- a/Gemfile +++ b/Gemfile @@ -104,5 +104,5 @@ gem 'ffi', '~> 1.16.3', require: false # Ruby 3.4 should be supported by strscan v3.1.1. However, the latest release of strscan is v3.1.0. # -# TODO: Remove this v3.1.0 requirement once v3.1.1 is released. -gem 'strscan', '3.1.0' if RUBY_VERSION.start_with?('3.4.') +# TODO: Remove this once v3.1.1 is released. +gem 'strscan', git: 'https://github.com/ruby/strscan' if RUBY_VERSION.start_with?('3.4.') diff --git a/spec/datadog/core/environment/execution_spec.rb b/spec/datadog/core/environment/execution_spec.rb index b84a88dc464..4595715886e 100644 --- a/spec/datadog/core/environment/execution_spec.rb +++ b/spec/datadog/core/environment/execution_spec.rb @@ -191,7 +191,8 @@ def test_it_does_something_useful Open3.capture3('ruby', stdin_data: script) end - skip('DEBUG') + # Ruby 3.4 outputs an exception instead of the information to be asserted because of the forked process. + pending('Pending for Ruby 3.4.') if RUBY_VERSION.start_with?('3.4.') expect(err).to include('ACTUAL:true') end end diff --git a/spec/datadog/core/error_spec.rb b/spec/datadog/core/error_spec.rb index 10fc4657c67..3120bf417b2 100644 --- a/spec/datadog/core/error_spec.rb +++ b/spec/datadog/core/error_spec.rb @@ -89,6 +89,8 @@ def call expect(error.message).to eq('wrapper layer') # Outer-most error first, inner-most last + # Ruby 3.4 adjusts the format of error messages and Hash#inspect renderings + # https://www.ruby-lang.org/en/news/2024/10/07/ruby-3-4-0-preview2-released/ wrapper_error_message = /in.*wrapper': wrapper layer \(RuntimeError\)/ wrapper_caller = /from.*in ['`]call'/ middle_error_message = /in.*middle': middle cause \(RuntimeError\)/