Skip to content

Commit

Permalink
Fix support for Ruby 2.3 and 2.4 in spec
Browse files Browse the repository at this point in the history
  • Loading branch information
ivoanjo committed Jun 6, 2024
1 parent 1f25717 commit 686b07c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion spec/datadog/profiling/native_extension_helpers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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('../')
Expand Down

0 comments on commit 686b07c

Please sign in to comment.