providers/hyperv: add test for windows guests
This commit is contained in:
parent
cae4a1c554
commit
35adc6063b
|
@ -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')
|
||||
|
|
|
@ -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
|
|
@ -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!
|
||||
|
|
Loading…
Reference in New Issue