2015-09-05 18:09:04 +00:00
|
|
|
|
|
|
|
require 'helper'
|
2015-10-26 03:04:18 +00:00
|
|
|
require 'inspec/resource'
|
2015-09-05 18:09:04 +00:00
|
|
|
|
2015-10-26 03:04:18 +00:00
|
|
|
describe 'Inspec::Resources::OsEnv' do
|
2015-11-19 02:50:38 +00:00
|
|
|
it 'verify env parsing' do
|
2015-10-12 11:21:50 +00:00
|
|
|
resource = load_resource('os_env', 'PATH')
|
2015-09-22 16:33:05 +00:00
|
|
|
_(resource.split).must_equal %w{/usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin}
|
2015-09-05 18:09:04 +00:00
|
|
|
end
|
2015-11-19 02:50:38 +00:00
|
|
|
|
|
|
|
it 'read env variable on Windows' do
|
|
|
|
resource = MockLoader.new(:windows).load_resource('os_env', 'PATH')
|
|
|
|
_(resource.split).must_equal ['C:\Windows\system32', 'C:\Windows', 'C:\Windows\System32\Wbem', 'C:\Windows\System32\WindowsPowerShell\v1.0\\', 'C:\opscode\chef\bin\\']
|
|
|
|
end
|
2015-09-05 18:09:04 +00:00
|
|
|
end
|