diff --git a/spec/unit/driver/cli_spec.rb b/spec/unit/driver/cli_spec.rb index 5ff5b0f..54e848b 100644 --- a/spec/unit/driver/cli_spec.rb +++ b/spec/unit/driver/cli_spec.rb @@ -146,9 +146,17 @@ describe Vagrant::LXC::Driver::CLI do end it 'supports a "namespaces" parameter' do + subject.stub(:run).with(:attach, '-h').and_return('--namespaces') subject.attach *(command + [{namespaces: ['network', 'mount']}]) subject.should have_received(:run).with(:attach, '--name', name, '--namespaces', 'NETWORK|MOUNT', '--', *command) end + + it 'raises a NamespacesNotSupported error if not supported' do + subject.stub(:run).with(:attach, '-h').and_return('not supported') + expect { + subject.attach *(command + [{namespaces: ['network', 'mount']}]) + }.to raise_error(Vagrant::LXC::Errors::NamespacesNotSupported) + end end describe 'transition block' do