From 198e1427947b042d9bca2ddbea5054a6bf9445fd Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 6 Jan 2014 10:55:34 -0800 Subject: [PATCH] commands/plugin: add more tests for installgem --- .../plugins/commands/plugin/action/install_gem_test.rb | 8 ++++---- test/unit/vagrant/plugin/manager_test.rb | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/test/unit/plugins/commands/plugin/action/install_gem_test.rb b/test/unit/plugins/commands/plugin/action/install_gem_test.rb index 5b046b434..df5362555 100644 --- a/test/unit/plugins/commands/plugin/action/install_gem_test.rb +++ b/test/unit/plugins/commands/plugin/action/install_gem_test.rb @@ -18,7 +18,7 @@ describe VagrantPlugins::CommandPlugin::Action::InstallGem do it "should install the plugin" do spec = Gem::Specification.new manager.should_receive(:install_plugin).with( - "foo", version: nil, require: nil, sources: nil).once.and_return(spec) + "foo", version: nil, require: nil, sources: nil, verbose: false).once.and_return(spec) app.should_receive(:call).with(env).once @@ -29,7 +29,7 @@ describe VagrantPlugins::CommandPlugin::Action::InstallGem do it "should specify the version if given" do spec = Gem::Specification.new manager.should_receive(:install_plugin).with( - "foo", version: "bar", require: nil, sources: nil).once.and_return(spec) + "foo", version: "bar", require: nil, sources: nil, verbose: false).once.and_return(spec) app.should_receive(:call).with(env).once @@ -41,7 +41,7 @@ describe VagrantPlugins::CommandPlugin::Action::InstallGem do it "should specify the entrypoint if given" do spec = Gem::Specification.new manager.should_receive(:install_plugin).with( - "foo", version: "bar", require: "baz", sources: nil).once.and_return(spec) + "foo", version: "bar", require: "baz", sources: nil, verbose: false).once.and_return(spec) app.should_receive(:call).with(env).once @@ -54,7 +54,7 @@ describe VagrantPlugins::CommandPlugin::Action::InstallGem do it "should specify the sources if given" do spec = Gem::Specification.new manager.should_receive(:install_plugin).with( - "foo", version: nil, require: nil, sources: ["foo"]).once.and_return(spec) + "foo", version: nil, require: nil, sources: ["foo"], verbose: false).once.and_return(spec) app.should_receive(:call).with(env).once diff --git a/test/unit/vagrant/plugin/manager_test.rb b/test/unit/vagrant/plugin/manager_test.rb index 3d6e728b4..d44127804 100644 --- a/test/unit/vagrant/plugin/manager_test.rb +++ b/test/unit/vagrant/plugin/manager_test.rb @@ -32,8 +32,9 @@ describe Vagrant::Plugin::Manager do it "installs the plugin and adds it to the state file" do specs = Array.new(5) { Gem::Specification.new } specs[3].name = "foo" - bundler.should_receive(:install).once.with do |plugins| + bundler.should_receive(:install).once.with do |plugins, local| expect(plugins).to have_key("foo") + expect(local).to be_false end.and_return(specs) result = subject.install_plugin("foo")