diff options
author | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-06-01 12:49:40 +0300 |
---|---|---|
committer | Hiroshi SHIBATA <hsbt@ruby-lang.org> | 2019-06-09 12:44:10 +0900 |
commit | 8f37629519ad330032a38ac0e871b2912ed38a1b (patch) | |
tree | bb0529b77583d47993d8b0d608d68896aa3a5298 /spec/bundler/commands/add_spec.rb | |
parent | 66508992483ae5d77b56a98427c50c772341c0ac (diff) |
Merge bundler master from upstream.
Pick from 8dd59e3ba97eb80a599f8149f31bf40773b69dc0
Diffstat (limited to 'spec/bundler/commands/add_spec.rb')
-rw-r--r-- | spec/bundler/commands/add_spec.rb | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/spec/bundler/commands/add_spec.rb b/spec/bundler/commands/add_spec.rb index dac1d0f6b9..f5b3f49bb1 100644 --- a/spec/bundler/commands/add_spec.rb +++ b/spec/bundler/commands/add_spec.rb @@ -11,6 +11,8 @@ RSpec.describe "bundle add" do build_gem "dog", "1.1.3.pre" end + build_git "foo", "2.0" + install_gemfile <<-G source "file://#{gem_repo2}" gem "weakling", "~> 0.0.1" @@ -21,7 +23,7 @@ RSpec.describe "bundle add" do it "shows error" do bundle "add" - expect(last_command.bundler_err).to include("Please specify gems to add") + expect(err).to include("Please specify gems to add") end end @@ -89,6 +91,28 @@ RSpec.describe "bundle add" do end end + describe "with --git" do + it "adds dependency with specified github source" do + bundle "add foo --git=#{lib_path("foo-2.0")}" + + expect(bundled_app("Gemfile").read).to match(/gem "foo", "~> 2.0", :git => "#{lib_path("foo-2.0")}"/) + expect(the_bundle).to include_gems "foo 2.0" + end + end + + describe "with --git and --branch" do + before do + update_git "foo", "2.0", :branch => "test" + end + + it "adds dependency with specified github source and branch" do + bundle "add foo --git=#{lib_path("foo-2.0")} --branch=test" + + expect(bundled_app("Gemfile").read).to match(/gem "foo", "~> 2.0", :git => "#{lib_path("foo-2.0")}", :branch => "test"/) + expect(the_bundle).to include_gems "foo 2.0" + end + end + describe "with --skip-install" do it "adds gem to Gemfile but is not installed" do bundle "add foo --skip-install --version=2.0" |