From 686b07ce80762e4f3320f752974c92873f651629 Mon Sep 17 00:00:00 2001 From: Ivo Anjo Date: Thu, 6 Jun 2024 09:28:18 +0100 Subject: [PATCH] Fix support for Ruby 2.3 and 2.4 in spec --- spec/datadog/profiling/native_extension_helpers_spec.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/datadog/profiling/native_extension_helpers_spec.rb b/spec/datadog/profiling/native_extension_helpers_spec.rb index 3e915f2d309..61aefbf14ac 100644 --- a/spec/datadog/profiling/native_extension_helpers_spec.rb +++ b/spec/datadog/profiling/native_extension_helpers_spec.rb @@ -51,7 +51,12 @@ extensions_relative, bundler_extensions_relative = described_class.libdatadog_folder_relative_to_ruby_extensions_folders - libdatadog_extension = RbConfig::CONFIG['SOEXT'] || raise('Missing SOEXT for current platform') + # RbConfig::CONFIG['SOEXT'] was only introduced in Ruby 2.5, so we have a fallback for older Rubies... + libdatadog_extension = + RbConfig::CONFIG['SOEXT'] || + ('so' if PlatformHelpers.linux?) || + ('dylib' if PlatformHelpers.mac?) || + raise('Missing SOEXT for current platform') libdatadog = "libdatadog_profiling.#{libdatadog_extension}" expect(extensions_relative).to start_with('../')