From 9b977694e6728d32ac3ddc3e8136da4c37c19b95 Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev <156273877+p-datadog@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:25:06 -0500 Subject: [PATCH] Fix execution spec with cucumber on ruby 3.4 (#4128) Cucumber is broken on ruby 3.4 currently, requires the fix in https://github.com/cucumber/cucumber-ruby/pull/1757 (not released yet). Use their master from git on ruby 3.4 and unpend the test. Co-authored-by: Oleg Pudeyev --- spec/datadog/core/environment/execution_spec.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/spec/datadog/core/environment/execution_spec.rb b/spec/datadog/core/environment/execution_spec.rb index 9169eb4ae4b..9d0d42455e7 100644 --- a/spec/datadog/core/environment/execution_spec.rb +++ b/spec/datadog/core/environment/execution_spec.rb @@ -173,7 +173,13 @@ def test_it_does_something_useful gemfile(true) do source 'https://rubygems.org' - gem 'cucumber', '>= 3' + if RUBY_VERSION >= '3.4' + # Cucumber is broken on Ruby 3.4, requires the fix in + # https://github.com/cucumber/cucumber-ruby/pull/1757 + gem 'cucumber', '>= 3', git: 'https://github.com/cucumber/cucumber-ruby' + else + gem 'cucumber', '>= 3' + end end load Gem.bin_path('cucumber', 'cucumber') @@ -192,8 +198,6 @@ def test_it_does_something_useful Open3.capture3('ruby', stdin_data: script) end - # 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