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
|
end
|
||||||
|
|
||||||
def destroy
|
def destroy
|
||||||
puts "TODO: Destroy container"
|
lxc :destroy, '--name', @name
|
||||||
File.delete(state_file_path) if state_file_path
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def wait_until(state)
|
def wait_until(state)
|
||||||
|
|
|
@ -96,6 +96,22 @@ describe Vagrant::LXC::Container do
|
||||||
end
|
end
|
||||||
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
|
describe 'start' do
|
||||||
let(:name) { 'container-name' }
|
let(:name) { 'container-name' }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue