diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/commands/add_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/commands/add_spec.rb b/spec/commands/add_spec.rb index 7d435916db..f5b3f49bb1 100644 --- a/spec/commands/add_spec.rb +++ b/spec/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" @@ -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" |