From 24c3c9a7ae5374fd3cf8bb8af5c576bc3f869a1d Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 30 Dec 2012 10:59:59 -1000 Subject: [PATCH] Better test coverage on with_target_vms. Added pending tests to work on. --- test/unit/vagrant/plugin/v2/command_test.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/unit/vagrant/plugin/v2/command_test.rb b/test/unit/vagrant/plugin/v2/command_test.rb index c7ed4c7b3..613868f2d 100644 --- a/test/unit/vagrant/plugin/v2/command_test.rb +++ b/test/unit/vagrant/plugin/v2/command_test.rb @@ -157,6 +157,26 @@ describe Vagrant::Plugin::V2::Command do instance.with_target_vms(name, :provider => provider) { |vm| vms << vm } vms.should == [vmware_vm] end + + it "should use the default provider if none is given and none are active" do + name = :foo + machine = double("machine") + + environment.stub(:machine).with(name, default_provider).and_return(machine) + machine.stub(:name => name, :provider => default_provider) + + results = [] + instance.with_target_vms(name) { |m| results << m } + results.should == [machine] + end + + it "should use the primary machine with the active provider" do + pending + end + + it "should use the primary machine with the default provider" do + pending + end end describe "splitting the main and subcommand args" do