Fix a couple of bundler issues with keyword argument separation

There are more issues than this, but hopefully this is enough
to get make test-bundler passing in CI.
This commit is contained in:
Jeremy Evans 2019-08-30 11:52:46 -07:00
parent 856bb3c35d
commit b5b3afadfa
Notes: git 2025-05-14 12:41:59 +00:00
2 changed files with 10 additions and 4 deletions

View File

@ -90,9 +90,14 @@ class Bundler::Thor
# ==== Parameters # ==== Parameters
# Hash[String|Array => Symbol]:: Maps the string or the strings in the array to the given command. # Hash[String|Array => Symbol]:: Maps the string or the strings in the array to the given command.
# #
def map(mappings = nil) def map(mappings = nil, **kw)
@map ||= from_superclass(:map, {}) @map ||= from_superclass(:map, {})
if mappings && !kw.empty?
mappings = kw.merge!(mappings)
else
mappings ||= kw
end
if mappings if mappings
mappings.each do |key, value| mappings.each do |key, value|
if key.respond_to?(:each) if key.respond_to?(:each)

View File

@ -88,9 +88,10 @@ RSpec.describe "bundler/inline#gemfile" do
RUBY RUBY
expect(out).to include("Installing activesupport") expect(out).to include("Installing activesupport")
err.gsub! %r{.*lib/sinatra/base\.rb:\d+: warning: constant ::Fixnum is deprecated$}, "" err.gsub! %r{(.*lib/sinatra/base\.rb:\d+: warning: constant ::Fixnum is deprecated$)}, ""
err.strip! err_lines = err.split("\n")
expect(err).to be_empty err_lines.reject!{|line| line =~ /\.rb:\d+: warning: The last/}
expect(err_lines).to be_empty
expect(exitstatus).to be_zero if exitstatus expect(exitstatus).to be_zero if exitstatus
end end