diff options
author | Asutosh Palai <asupalai@gmail.com> | 2016-06-07 20:12:07 +0530 |
---|---|---|
committer | Asutosh Palai <asupalai@gmail.com> | 2016-06-07 20:15:19 +0530 |
commit | 1a9857473bbd7b91a5abd0b2e7da144f375ff761 (patch) | |
tree | 3dcce32238261351ab998e50043177b317dd5f30 /spec | |
parent | 4a1baea541298628d47b04520f23f9b3c6af0265 (diff) | |
download | bundler-1a9857473bbd7b91a5abd0b2e7da144f375ff761.tar.gz |
Multiple plugins to be installed by cli install
Diffstat (limited to 'spec')
-rw-r--r-- | spec/bundler/plugin/installer_spec.rb | 23 | ||||
-rw-r--r-- | spec/bundler/plugin_spec.rb | 15 | ||||
-rw-r--r-- | spec/plugins/command.rb | 2 |
3 files changed, 20 insertions, 20 deletions
diff --git a/spec/bundler/plugin/installer_spec.rb b/spec/bundler/plugin/installer_spec.rb index c7e865dc..0cda970b 100644 --- a/spec/bundler/plugin/installer_spec.rb +++ b/spec/bundler/plugin/installer_spec.rb @@ -12,18 +12,19 @@ describe Bundler::Plugin::Installer do describe "with mocked installers" do it "returns the installation path after installing git plugins" do - allow(installer).to receive(:install_git).and_return("/git/install/path") + allow(installer).to receive(:install_git). + and_return("new-plugin" => "/git/install/path") - expect(installer.install("new-plugin", :git => "https://some.ran/dom")). - to eq("/git/install/path") + expect(installer.install(["new-plugin"], :git => "https://some.ran/dom")). + to eq("new-plugin" => "/git/install/path") end it "returns the installation path after installing rubygems plugins" do allow(installer).to receive(:install_rubygems). - and_return("/rubygems/install/path") + and_return("new-plugin" => "/rubygems/install/path") - expect(installer.install("new-plugin", :source => "https://some.ran/dom")). - to eq("/rubygems/install/path") + expect(installer.install(["new-plugin"], :source => "https://some.ran/dom")). + to eq("new-plugin" => "/rubygems/install/path") end end @@ -34,12 +35,10 @@ describe Bundler::Plugin::Installer do end rev = revision_for(lib_path("ga-plugin")) - expected_path = Bundler::Plugin.root. - join("bundler", "gems", "ga-plugin-#{rev[0..11]}") + expected = { "ga-plugin" => Bundler::Plugin.root.join("bundler", "gems", "ga-plugin-#{rev[0..11]}").to_s } opts = { :git => "file://#{lib_path("ga-plugin")}" } - expect(installer.install("ga-plugin", opts)). - to eq(expected_path) + expect(installer.install(["ga-plugin"], opts)).to eq(expected) end it "returns the installation path after installing rubygems plugins" do @@ -48,8 +47,8 @@ describe Bundler::Plugin::Installer do end opts = { :source => "file://#{gem_repo2}" } - expect(installer.install("re-plugin", opts)). - to eq(plugin_gems("re-plugin-1.0").to_s) + expect(installer.install(["re-plugin"], opts)). + to eq("re-plugin" => plugin_gems("re-plugin-1.0").to_s) end end end diff --git a/spec/bundler/plugin_spec.rb b/spec/bundler/plugin_spec.rb index a46e5550..573a5d22 100644 --- a/spec/bundler/plugin_spec.rb +++ b/spec/bundler/plugin_spec.rb @@ -25,29 +25,30 @@ describe Bundler::Plugin do let(:opts) { { "version" => "~> 1.0", "source" => "foo" } } before do - allow(installer). - to receive(:install).with("new-plugin", opts) { lib_path("new-plugin") } + allow(installer).to receive(:install).with(["new-plugin"], opts) do + { "new_plugin" => lib_path("new-plugin") } + end end it "passes the name and options to installer" do - allow(installer).to receive(:install).with("new-plugin", opts) do - lib_path("new-plugin") + allow(installer).to receive(:install).with(["new-plugin"], opts) do + { "new-plugin" => lib_path("new-plugin").to_s } end.once - subject.install "new-plugin", opts + subject.install ["new-plugin"], opts end it "validates the installed plugin" do allow(subject). to receive(:validate_plugin!).with(lib_path("new-plugin")).once - subject.install "new-plugin", opts + subject.install ["new-plugin"], opts end it "registers the plugin with index" do allow(index).to receive(:register_plugin). with("new-plugin", lib_path("new-plugin").to_s, []).once - subject.install "new-plugin", opts + subject.install ["new-plugin"], opts end end diff --git a/spec/plugins/command.rb b/spec/plugins/command.rb index 4ad58fb2..71e87a5b 100644 --- a/spec/plugins/command.rb +++ b/spec/plugins/command.rb @@ -74,7 +74,7 @@ describe "command plugins" do expect(out).not_to include("Installed plugin copycat") - expect(out).to include("Failed to install plugin copycat") + expect(out).to include("Failed to install plugin") expect(out).to include("Command(s) `mahcommand` declared by copycat are already registered.") end |