mirror of
https://github.com/hashicorp/vagrant.git
synced 2026-05-28 04:36:05 -04:00
Hyperv: add tests for --force flag support for stop VM
This commit is contained in:
parent
3bb828a8d9
commit
2de0d7e79c
1 changed files with 29 additions and 0 deletions
|
|
@ -0,0 +1,29 @@
|
|||
require_relative "../../../../base"
|
||||
|
||||
require Vagrant.source_root.join("plugins/providers/hyperv/action/halt_instance")
|
||||
|
||||
describe VagrantPlugins::HyperV::Action::HaltInstance do
|
||||
let(:app){ double("app") }
|
||||
let(:env){ {ui: ui, machine: machine} }
|
||||
let(:ui){ double("ui") }
|
||||
let(:provider){ double("provider", driver: driver) }
|
||||
let(:driver){ double("driver") }
|
||||
let(:machine){ double("machine", provider: provider, data_dir: "/dev/null") }
|
||||
let(:subject){ described_class.new(app, env) }
|
||||
|
||||
before do
|
||||
allow(app).to receive(:call)
|
||||
allow(ui).to receive(:info)
|
||||
allow(driver).to receive(:halt)
|
||||
end
|
||||
|
||||
it "should call the app on success" do
|
||||
expect(app).to receive(:call)
|
||||
subject.call(env)
|
||||
end
|
||||
|
||||
it "should call the driver to halt the vm" do
|
||||
expect(driver).to receive(:halt)
|
||||
subject.call(env)
|
||||
end
|
||||
end
|
||||
Loading…
Reference in a new issue