From fd133241dff9f9834c5f6d17f87589b28731068d Mon Sep 17 00:00:00 2001 From: Oleg Pudeyev Date: Mon, 18 Nov 2024 15:25:47 -0500 Subject: [PATCH] Run the cucumber test in unbundled environment --- spec/datadog/core/environment/execution_spec.rb | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/spec/datadog/core/environment/execution_spec.rb b/spec/datadog/core/environment/execution_spec.rb index 9d0d42455e..42b2a1ec57 100644 --- a/spec/datadog/core/environment/execution_spec.rb +++ b/spec/datadog/core/environment/execution_spec.rb @@ -189,16 +189,18 @@ def test_it_does_something_useful it 'returns true' do Dir.mktmpdir do |dir| Dir.chdir(dir) do - FileUtils.mkdir_p('features/support') + Bundler.with_unbundled_env do + FileUtils.mkdir_p('features/support') - # Add our script to `env.rb`, which is always run before any feature is executed. - File.write('features/support/env.rb', repl_script) + # Add our script to `env.rb`, which is always run before any feature is executed. + File.write('features/support/env.rb', repl_script) - _, err, = Bundler.with_unbundled_env do - Open3.capture3('ruby', stdin_data: script) - end + _, err, = Bundler.with_unbundled_env do + Open3.capture3('ruby', stdin_data: script) + end - expect(err).to include('ACTUAL:true') + expect(err).to include('ACTUAL:true') + end end end end