Fail when `mkdir' misses arguments

This commit is contained in:
Thibault Jouan
2014-10-09 20:12:44 +00:00
parent fdfd5df26f
commit 3f82b923b7
2 changed files with 13 additions and 10 deletions

View File

@@ -5,8 +5,8 @@ module Producer::Core
describe Mkdir, :env do
let(:path) { 'some_path' }
let(:options) { { } }
let(:arguments) { [path, options] }
subject(:mkdir) { described_class.new(env, *arguments) }
let(:arguments) { [path] }
subject(:mkdir) { described_class.new(env, *arguments, options) }
it_behaves_like 'action'
@@ -20,6 +20,14 @@ module Producer::Core
it 'translates user option as owner' do
expect(mkdir.options[:owner]).to eq 'root'
end
context 'when path is missing' do
let(:path) { nil }
it 'raises ArgumentError' do
expect { mkdir }.to raise_error ArgumentError
end
end
end
describe '#apply' do