diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/commands/inject_spec.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/commands/inject_spec.rb b/spec/commands/inject_spec.rb index dd5e22498b..5c711b32a0 100644 --- a/spec/commands/inject_spec.rb +++ b/spec/commands/inject_spec.rb @@ -52,6 +52,31 @@ Usage: "bundle inject GEM VERSION" end end + context "with source option" do + it "add gem with source option in gemfile" do + bundle "inject 'foo' '>0' --source file://#{gem_repo1}" + gemfile = bundled_app("Gemfile").read + str = "gem 'foo', '> 0', :source => 'file://#{gem_repo1}'" + expect(gemfile).to include str + end + end + + context "with group option" do + it "add gem with group option 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 include str + end + + it "add gem with multiple groups in gemfile" do + bundle "inject 'rack-obama' '>0' --group=development,test" + gemfile = bundled_app("Gemfile").read + str = "gem 'rack-obama', '> 0', :groups => [:development, :test]" + expect(gemfile).to include str + end + end + context "when frozen" do before do bundle "install" |