mirror of
https://github.com/inspec/inspec
synced 2024-11-10 15:14:23 +00:00
add os_env unit test
This commit is contained in:
parent
672f03a0dd
commit
faf7f44a42
3 changed files with 18 additions and 1 deletions
|
@ -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
1
test/unit/mock/cmd/PATH
Normal file
|
@ -0,0 +1 @@
|
||||||
|
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
15
test/unit/resource_os_env_test.rb
Normal file
15
test/unit/resource_os_env_test.rb
Normal 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
|
Loading…
Reference in a new issue