summaryrefslogtreecommitdiff
path: root/spec/commands/add_spec.rb
diff options
context:
space:
mode:
authorBoggs <hello@boggs.xyz>2016-06-29 10:06:56 +0800
committerBoggs <hello@boggs.xyz>2016-06-29 10:06:56 +0800
commitba6c83d116976e8ce27a4e9848fc392ba3979948 (patch)
tree9e16ec46610c7adb925cccf25bb086e340e18db6 /spec/commands/add_spec.rb
parent0924cd90891b214a2c581216132c38392ded4eff (diff)
downloadbundler-ba6c83d116976e8ce27a4e9848fc392ba3979948.tar.gz
Add specs for multiple options
Diffstat (limited to 'spec/commands/add_spec.rb')
-rw-r--r--spec/commands/add_spec.rb23
1 files changed, 21 insertions, 2 deletions
diff --git a/spec/commands/add_spec.rb b/spec/commands/add_spec.rb
index 6af89063ba..815a3a6c17 100644
--- a/spec/commands/add_spec.rb
+++ b/spec/commands/add_spec.rb
@@ -18,7 +18,7 @@ describe "bundle add" do
it "adds gem with provided version and version operator" do
update_repo2 do
- build_gem "activesupport", "3.0"
+ build_gem "activesupport", "3.0.0"
end
bundle "add activesupport '> 2.3.5'"
@@ -34,6 +34,7 @@ describe "bundle add" do
it "adds the gem with the last prerelease version" do
update_repo2 do
+ build_gem "activesupport", "3.0.0"
build_gem "activesupport", "3.0.0.beta"
end
@@ -50,9 +51,27 @@ describe "bundle add" do
end
context "when source is set" do
- it "adds the gem with the specified source" do
+ it "adds the gem with a specified source" do
bundle "add activesupport --source file://#{gem_repo2}"
expect(bundled_app("Gemfile").read).to include("gem 'activesupport', '~> 2.3.5', :source => 'file:\/\/#{gem_repo2}'")
end
end
+
+ context "when multiple options are set" do
+ before :each do
+ update_repo2 do
+ build_gem "activesupport", "3.0.0"
+ end
+ end
+
+ it "adds the gem with a specified group and source" do
+ bundle "add activesupport --group test --source file://#{gem_repo2}"
+ expect(bundled_app("Gemfile").read).to include("gem 'activesupport', '~> 3.0.0', :group => [:test], :source => 'file:\/\/#{gem_repo2}'")
+ end
+
+ it "adds the gem with a specified version, group, and source" do
+ bundle "add activesupport 2.3.5 --group development --source file://#{gem_repo2}"
+ expect(bundled_app("Gemfile").read).to include("gem 'activesupport', '~> 2.3.5', :group => [:development], :source => 'file:\/\/#{gem_repo2}'")
+ end
+ end
end