add os_env unit test

This commit is contained in:
Christoph Hartmann 2015-09-05 20:09:04 +02:00 committed by Dominik Richter
parent 672f03a0dd
commit faf7f44a42
3 changed files with 18 additions and 1 deletions

View file

@ -20,7 +20,8 @@ def loadResource (resource, *args)
'ps aux' => IO::File.join(scriptpath, '/unit/mock/cmd/ps-aux'), 'ps aux' => IO::File.join(scriptpath, '/unit/mock/cmd/ps-aux'),
'type win_secpol.cfg' => IO::File.join(scriptpath, '/unit/mock/cmd/secedit-export'), 'type win_secpol.cfg' => IO::File.join(scriptpath, '/unit/mock/cmd/secedit-export'),
'secedit /export /cfg win_secpol.cfg' => IO::File.join(scriptpath, '/unit/mock/cmd/success'), 'secedit /export /cfg win_secpol.cfg' => IO::File.join(scriptpath, '/unit/mock/cmd/success'),
'del win_secpol.cfg' => IO::File.join(scriptpath, '/unit/mock/cmd/success') 'del win_secpol.cfg' => IO::File.join(scriptpath, '/unit/mock/cmd/success'),
'su - root -c \'echo $PATH\'' => IO::File.join(scriptpath, '/unit/mock/cmd/PATH')
} }
# create mock backend # create mock backend

1
test/unit/mock/cmd/PATH Normal file
View file

@ -0,0 +1 @@
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

View file

@ -0,0 +1,15 @@
# encoding: utf-8
require 'helper'
require 'vulcano/resource'
describe 'Vulcano::Resources::OsEnv' do
describe 'os_env' do
let(:resource) { loadResource('os_env', 'PATH') }
it 'verify ntp config parsing' do
_(resource.split).must_equal %w{/usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin}
end
end
end