diff options
-rw-r--r-- | lib/bundler/cli/init.rb | 6 | ||||
-rw-r--r-- | spec/commands/init_spec.rb | 2 |
2 files changed, 2 insertions, 6 deletions
diff --git a/lib/bundler/cli/init.rb b/lib/bundler/cli/init.rb index 774736f708..8ffd1db41a 100644 --- a/lib/bundler/cli/init.rb +++ b/lib/bundler/cli/init.rb @@ -19,11 +19,7 @@ module Bundler exit 1 end - spec = Gem::Specification.load(gemspec) - unless spec - Bundler.ui.error "Gem specification #{gemspec} is invalid" - exit 1 - end + spec = Bundler.load_gemspec_uncached(gemspec) puts "Writing new Gemfile to #{SharedHelpers.pwd}/Gemfile" File.open("Gemfile", "wb") do |file| diff --git a/spec/commands/init_spec.rb b/spec/commands/init_spec.rb index c2477820a1..6bbbfa8c96 100644 --- a/spec/commands/init_spec.rb +++ b/spec/commands/init_spec.rb @@ -58,7 +58,7 @@ RSpec.describe "bundle init" do end bundle :init, :gemspec => spec_file - expect(out).to include("Gem specification #{spec_file} is invalid") + expect(out).to include("There was an error while loading `test.gemspec`") end end end |