lxc-destroy: check
This commit is contained in:
parent
b02cf9c5e8
commit
b8e5a9fa1c
2 changed files with 17 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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' }
|
||||
|
||||
|
|
Loading…
Reference in a new issue