lxc-destroy: check

This commit is contained in:
Fabio Rehm 2013-03-02 01:34:47 -03:00
parent b02cf9c5e8
commit b8e5a9fa1c
2 changed files with 17 additions and 2 deletions

View file

@ -47,8 +47,7 @@ module Vagrant
end
def destroy
puts "TODO: Destroy container"
File.delete(state_file_path) if state_file_path
lxc :destroy, '--name', @name
end
def wait_until(state)

View file

@ -96,6 +96,22 @@ describe Vagrant::LXC::Container do
end
end
describe 'destruction' do
let(:name) { 'container-name' }
before do
subject.stub(lxc: true)
subject.destroy
end
it 'calls lxc-create with the right arguments' do
subject.should have_received(:lxc).with(
:destroy,
'--name', name,
)
end
end
describe 'start' do
let(:name) { 'container-name' }