summaryrefslogtreecommitdiff
path: root/spec/bundler/support/options.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/bundler/support/options.rb')
-rw-r--r--spec/bundler/support/options.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/bundler/support/options.rb b/spec/bundler/support/options.rb
new file mode 100644
index 0000000000..551fa1acd8
--- /dev/null
+++ b/spec/bundler/support/options.rb
@@ -0,0 +1,15 @@
+# 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