mirror of
https://github.com/inspec/inspec
synced 2024-11-27 15:10:44 +00:00
beade346bf
This change allows checks like: ``` describe os_env('PATH') do its('split') { should include('C:\wix') } end ```
18 lines
631 B
Ruby
18 lines
631 B
Ruby
# encoding: utf-8
|
|
# author: Christoph Hartmann
|
|
# author: Dominik Richter
|
|
|
|
require 'helper'
|
|
require 'inspec/resource'
|
|
|
|
describe 'Inspec::Resources::OsEnv' do
|
|
it 'verify env parsing' do
|
|
resource = load_resource('os_env', 'PATH')
|
|
_(resource.split).must_equal %w{/usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin}
|
|
end
|
|
|
|
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
|
|
end
|