diff --git a/lib/vagrant-lxc/container/cli.rb b/lib/vagrant-lxc/container/cli.rb index 01bce47..2939233 100644 --- a/lib/vagrant-lxc/container/cli.rb +++ b/lib/vagrant-lxc/container/cli.rb @@ -46,8 +46,8 @@ module Vagrant run :destroy, '--name', @name end - def start(configs = {}) - configs = configs.map { |key, value| ["-s", "#{key}=#{value}"] }.flatten + def start(configs = []) + configs = configs.map { |conf| ["-s", conf] }.flatten run :start, '-d', '--name', @name, *configs end diff --git a/spec/unit/container/cli_spec.rb b/spec/unit/container/cli_spec.rb index 11152eb..9a797a7 100644 --- a/spec/unit/container/cli_spec.rb +++ b/spec/unit/container/cli_spec.rb @@ -82,7 +82,7 @@ describe Vagrant::LXC::Container::CLI do end it 'uses provided hash to configure the container' do - subject.start('lxc.config' => 'value', 'lxc.other' => 'value') + subject.start(['lxc.config=value', 'lxc.other=value']) subject.should have_received(:run).with(:start, '-d', '--name', name, '-s', 'lxc.config=value', '-s', 'lxc.other=value'