From 45345b0362b530af38e0b810003de5d62c7c990e Mon Sep 17 00:00:00 2001 From: shekharrajak Date: Tue, 21 Feb 2017 15:16:12 +0530 Subject: [PATCH] minor changes --- lib/bundler/cli.rb | 4 ++-- spec/commands/inject_spec.rb | 16 ++++++---------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 80332de3c21..9ae53c0142b 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -466,9 +466,9 @@ def platform desc "inject GEM VERSION", "Add the named gem, with version requirements, to the resolved Gemfile" method_option "source", :type => :string, :banner => - "Use the specific source for the gem" + "Install gem from the given source" method_option "group", :type => :string, :banner => - "Put the gem into specific group" + "Install gem into a bundler group" def inject(name, version) SharedHelpers.major_deprecation "The `inject` command has been replaced by the `add` command" require "bundler/cli/inject" diff --git a/spec/commands/inject_spec.rb b/spec/commands/inject_spec.rb index 2a5e8880f01..50ffa5c226a 100644 --- a/spec/commands/inject_spec.rb +++ b/spec/commands/inject_spec.rb @@ -52,26 +52,22 @@ end end - context "use source and group options" do + context "with source option" do it "add gem with source in gemfile" do bundle "inject 'bootstrap' '>0' --source=https://rubygems.org" gemfile = bundled_app("Gemfile").read str = "gem 'bootstrap', '> 0', :source => 'https://rubygems.org'" - expect(gemfile).to match(/str/) + expect(gemfile).to include str end + end + + context "with group option" do it "add gem with group in gemfile" do bundle "inject 'rack-obama' '>0' --group=development" gemfile = bundled_app("Gemfile").read str = "gem 'rack-obama', '> 0', :group => [:development]" - expect(gemfile).to match(/str/) - end - - it "add gem with source and group in gemfile" do - bundle "inject 'rails' '>0' --source=https://rubygems.org --group=development" - gemfile = bundled_app("Gemfile").read - str = "gem 'rails', '> 0', :group => [:development], :source => 'https://rubygems.org'" - expect(gemfile).to match(/str/) + expect(gemfile).to include str end end