summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2016-08-21 08:27:02 +0700
committerAndre Arko <andre@arko.net>2016-08-22 09:42:41 +0700
commit67f5a23bf439a01f1cf3c28bc9b0d549649bf2cd (patch)
tree15885405ef0641b9228cc63c5f7acd8031a0db9e
parent3d32ddd09988502017d555d0f5c0751fcd528861 (diff)
downloadbundler-67f5a23bf439a01f1cf3c28bc9b0d549649bf2cd.tar.gz
postpone the `add` command until 1.14
see also #4901
-rw-r--r--lib/bundler/cli.rb10
-rw-r--r--spec/commands/add_spec.rb84
2 files changed, 0 insertions, 94 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 875fc757e8..94a630a9f1 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -467,16 +467,6 @@ module Bundler
Env.new.write($stdout)
end
- desc "add GEM [VERSION]", "Add the specified gem to the bottom of Gemfile"
- method_option "group", :type => :array, :aliases => "-g", :desc => "Specify groups to add the gem in"
- method_option "source", :type => :string, :aliases => "-s", :desc => "Specify the gem's source"
- method_option "pre", :type => :boolean, :aliases => "-p", :default => false, :desc => "Check for newer pre-release gems"
- method_option "timestamp", :type => :boolean, :aliases => "-t", :default => false, :desc => "Append timestamp to Gemfile"
- def add(name, version = nil, *gems)
- require "bundler/cli/inject"
- Inject.new(options, name, version, gems).run
- end
-
desc "doctor [OPTIONS]", "Checks the bundle for common problems"
long_desc <<-D
Doctor scans the OS dependencies of each of the gems requested in the Gemfile. If
diff --git a/spec/commands/add_spec.rb b/spec/commands/add_spec.rb
deleted file mode 100644
index f650b6ce56..0000000000
--- a/spec/commands/add_spec.rb
+++ /dev/null
@@ -1,84 +0,0 @@
-# frozen_string_literal: true
-require "spec_helper"
-
-describe "bundle add" do
- before :each do
- gemfile <<-G
- source "file://#{gem_repo1}"
- G
- end
-
- context "when version number is set" do
- it "adds gem with provided version" do
- bundle "add activesupport 2.3.5"
- expect(bundled_app("Gemfile").read).to include("gem 'activesupport', '~> 2.3.5'")
- end
-
- it "adds gem with provided version and version operator" do
- update_repo2 do
- build_gem "activesupport", "3.0.0"
- end
-
- bundle "add activesupport '> 2.3.5'"
- expect(bundled_app("Gemfile").read).to include("gem 'activesupport', '> 2.3.5'")
- end
- end
-
- context "when version number is not set" do
- it "adds gem with last stable version" do
- bundle "add activesupport"
- expect(bundled_app("Gemfile").read).to include("gem 'activesupport', '~> 2.3.5'")
- end
-
- it "`--pre` flag adds the gem with the latest prerelease version" do
- update_repo2 do
- build_gem "activesupport", "3.0.0.beta"
- end
-
- bundle "add activesupport --pre"
- expect(bundled_app("Gemfile").read).to include("gem 'activesupport', '~> 3.0.0.beta'")
- end
-
- it "`--pre` flag adds the gem with the latest non-prerelease version if it is available" do
- update_repo2 do
- build_gem "activesupport", "3.0.0.beta"
- build_gem "activesupport", "3.0.0"
- end
-
- bundle "add activesupport --pre"
- expect(bundled_app("Gemfile").read).to include("gem 'activesupport', '~> 3.0.0'")
- end
- end
-
- context "when group is set" do
- it "adds the gem with the specified groups" do
- bundle "add activesupport --group development test"
- expect(bundled_app("Gemfile").read).to include("gem 'activesupport', '~> 2.3.5', :group => [:development, :test]")
- end
- end
-
- context "when source is set" 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