diff options
author | Asutosh Palai <asupalai@gmail.com> | 2016-05-20 17:35:12 +0530 |
---|---|---|
committer | Asutosh Palai <asupalai@gmail.com> | 2016-05-24 21:15:01 +0530 |
commit | d65b6cea7076d17e7ab49d6391d16389e36cbeeb (patch) | |
tree | 7bb8e6cd07369294cdb1241768c7f5cafe8b0380 | |
parent | 011c69901ae3a103ec91385378f3df70b0f778d2 (diff) | |
download | bundler-d65b6cea7076d17e7ab49d6391d16389e36cbeeb.tar.gz |
Added few specs for plugin install
-rw-r--r-- | spec/plugins/install.rb | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/spec/plugins/install.rb b/spec/plugins/install.rb new file mode 100644 index 0000000000..793a4043c4 --- /dev/null +++ b/spec/plugins/install.rb @@ -0,0 +1,47 @@ +#frozen_string_literal: true +require 'spec_helper' + +describe "bundler plugin install" do + before do + build_repo2 do + build_gem "foo" do |s| + s.write "plugin.rb" + end + end + end + + it "fails when source in not provided" do + bundle "plugin install foo" + + expect(out).to include("You need to provide the source") + + expect(out).not_to include("Installed plugin") + end + + it "shows propper message when gem in not found in the source" do + bundle "plugin install no-foo --source file://#{gem_repo1}" + + expect(out).to include("Could not find") + end + + it "installs from rubygems source" do + bundle "plugin install foo --source file://#{gem_repo2}" + + expect(out).to include("Installed plugin foo") + end + + it "shows error for plugins with dependencies" do + build_repo2 do + build_gem "kung-foo" do |s| + s.write "plugin.rb" + s.add_dependency "rake" + end + end + + bundle "plugin install kung-foo --source file://#{gem_repo2}" + + expect(out).to include("Plugin dependencies are not supported") + + expect(out).not_to include("Installed plugin") + end +end |