diff --git a/lib/datadog/ci/test_optimisation/skippable_percentage/calculator.rb b/lib/datadog/ci/test_optimisation/skippable_percentage/calculator.rb index f2aa1b83..bed98b8f 100644 --- a/lib/datadog/ci/test_optimisation/skippable_percentage/calculator.rb +++ b/lib/datadog/ci/test_optimisation/skippable_percentage/calculator.rb @@ -66,7 +66,7 @@ def dry_run cli_options_array = @rspec_cli_options + ["--dry-run", @spec_path] rspec_config_options = ::RSpec::Core::ConfigurationOptions.new(cli_options_array) - devnull = File.new("/dev/null", "w") + devnull = File.new(File::NULL, "w") out = @verbose ? $stdout : devnull err = @verbose ? $stderr : devnull diff --git a/spec/support/rspec_helpers.rb b/spec/support/rspec_helpers.rb index 98e0e78d..967e54da 100644 --- a/spec/support/rspec_helpers.rb +++ b/spec/support/rspec_helpers.rb @@ -16,6 +16,6 @@ def with_new_rspec_environment end def devnull - File.new("/dev/null", "w") + File.new(File::NULL, "w") end end