ruby/spec/bundler/support/options.rb
David Rodriguez da75df2f75 [rubygems/rubygems] Stop depending on pathname for subprocess launching
When launching bundler subprocesses for end to end testing, all of them
will load the `spec/support/rubygems_version_manager.rb` file passed as
a ruby's `-r` flag.

Unfortunately this file depends on `pathname`, so unless we drop that
dependency, we can't really test support for including the `pathname`
gem in the `Gemfile`.

This commit implements some refactorings to avoid loading `pathname`
inside `bundler` test subprocesses.

c1f948788c
2024-06-06 18:44:52 +00:00

15 lines
327 B
Ruby

# frozen_string_literal: true
module Spec
module Options
def opt_add(option, options)
[option.strip, options].compact.reject(&:empty?).join(" ")
end
def opt_remove(option, options)
return unless options
options.split(" ").reject {|opt| opt.strip == option.strip }.join(" ")
end
end
end