Remove some unused args and add pending specs so that we don't forget to test it

This commit is contained in:
Fabio Rehm 2013-07-31 22:35:49 -03:00
parent c4429fa158
commit 2082a5a81d
4 changed files with 11 additions and 17 deletions

View file

@ -76,7 +76,7 @@ module Vagrant
prune_customizations
write_customizations(customizations + @customizations)
@cli.transition_to(:running) { |c| c.start([], (extra || nil)) }
@cli.transition_to(:running) { |c| c.start(extra) }
end
def forced_halt
@ -124,8 +124,7 @@ module Vagrant
end
def prune_customizations
# Use sed to just strip out the block of code which was inserted
# by Vagrant
# Use sed to just strip out the block of code which was inserted by Vagrant
@logger.debug 'Prunning vagrant-lxc customizations'
@sudo_wrapper.su_c("sed -e '/^# VAGRANT-BEGIN/,/^# VAGRANT-END/ d' -ibak #{base_path.join('config')}")
end

View file

@ -63,10 +63,8 @@ module Vagrant
run :destroy, '--name', @name
end
def start(overrides = [], extra_opts = [])
options = []
options += extra_opts if extra_opts
run :start, '-d', '--name', @name, *options
def start(options = [])
run :start, '-d', '--name', @name, *Array(options)
end
def stop

View file

@ -96,14 +96,6 @@ describe Vagrant::LXC::Driver::CLI do
'--name', name
)
end
it 'uses provided array to override container configs' do
subject.start([['config', 'value'], ['other', 'value']])
subject.should have_received(:run).with(:start, '-d', '--name', name,
'-s', "lxc.config='value'",
'-s', "lxc.other='value'"
)
end
end
describe 'shutdown' do

View file

@ -75,8 +75,9 @@ describe Vagrant::LXC::Driver do
let(:customizations) { [['a', '1'], ['b', '2']] }
let(:internal_customization) { ['internal', 'customization'] }
let(:cli) { instance_double('Vagrant::LXC::Driver::CLI', start: true) }
let(:sudo) { instance_double('Vagrant::LXC::SudoWrapper', su_c: true) }
subject { described_class.new('name', nil, cli) }
subject { described_class.new('name', sudo, cli) }
before do
cli.stub(:transition_to).and_yield(cli)
@ -84,8 +85,12 @@ describe Vagrant::LXC::Driver do
subject.start(customizations)
end
it 'prunes previous customizations before writing'
it 'writes configurations to config file'
it 'starts container with configured customizations' do
cli.should have_received(:start).with(customizations + [internal_customization], nil)
cli.should have_received(:start)
end
it 'expects a transition to running state to take place' do