providers/hyperv: add test for windows guests

This commit is contained in:
Mitchell Hashimoto 2014-03-05 18:50:31 -08:00
parent cae4a1c554
commit 35adc6063b
3 changed files with 30 additions and 0 deletions

View File

@ -173,6 +173,7 @@ module VagrantPlugins
action_root = Pathname.new(File.expand_path("../action", __FILE__))
autoload :DeleteVM, action_root.join("delete_vm")
autoload :Import, action_root.join("import")
autoload :IsWindows, action_root.join("is_windows")
autoload :ReadState, action_root.join("read_state")
autoload :ResumeVM, action_root.join("resume_vm")
autoload :StartInstance, action_root.join('start_instance')

View File

@ -0,0 +1,16 @@
module VagrantPlugins
module HyperV
module Action
class IsWindows
def initialize(app, env)
@app = app
end
def call(env)
env[:result] = env[:machine].config.vm.guest == :windows
@app.call(env)
end
end
end
end
end

View File

@ -89,6 +89,19 @@ describe VagrantPlugins::Kernel_V2::VMConfig do
end
end
describe "#guest" do
it "is nil by default" do
subject.finalize!
expect(subject.guest).to be_nil
end
it "is symbolized" do
subject.guest = "foo"
subject.finalize!
expect(subject.guest).to eq(:foo)
end
end
describe "#network(s)" do
it "defaults to forwarding SSH" do
subject.finalize!