diff options
author | Andre Arko <andre@arko.net> | 2016-08-21 08:27:02 +0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2016-08-21 11:13:26 +0700 |
commit | 30941b3cd9f825379faf716919651fe091b9c5d6 (patch) | |
tree | c44a33dfa8f4867bd71ff662ca248b5ce0f9d275 | |
parent | 3425c96efeaaa3dc7eacc30234b5a2e973ec429f (diff) | |
download | bundler-30941b3cd9f825379faf716919651fe091b9c5d6.tar.gz |
postpone the `add` command until 1.14
see also #4901
-rw-r--r-- | lib/bundler/cli.rb | 10 | ||||
-rw-r--r-- | spec/commands/add_spec.rb | 84 |
2 files changed, 0 insertions, 94 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 11874e6362..0453480401 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 |