From e231890e7e2f5df65b2b2c2b90e05774e76e7a95 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 5 Jan 2014 21:10:43 -0800 Subject: [PATCH] commands/plugin: UninstallPlugin tests --- .../plugin/action/uninstall_plugin_test.rb | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/unit/plugins/commands/plugin/action/uninstall_plugin_test.rb diff --git a/test/unit/plugins/commands/plugin/action/uninstall_plugin_test.rb b/test/unit/plugins/commands/plugin/action/uninstall_plugin_test.rb new file mode 100644 index 000000000..ffe17122e --- /dev/null +++ b/test/unit/plugins/commands/plugin/action/uninstall_plugin_test.rb @@ -0,0 +1,24 @@ +require File.expand_path("../../../../../base", __FILE__) + +describe VagrantPlugins::CommandPlugin::Action::UninstallPlugin do + let(:app) { lambda { |env| } } + let(:env) {{ + ui: Vagrant::UI::Silent.new, + }} + + let(:manager) { double("manager") } + + subject { described_class.new(app, env) } + + before do + Vagrant::Plugin::Manager.stub(instance: manager) + end + + it "uninstalls the specified plugin" do + manager.should_receive(:uninstall_plugin).with("bar").ordered + app.should_receive(:call).ordered + + env[:plugin_name] = "bar" + subject.call(env) + end +end