2019-06-11 22:24:35 +00:00
|
|
|
require "helper"
|
|
|
|
require "inspec/resource"
|
|
|
|
require "inspec/resources/os_env"
|
2015-09-05 18:09:04 +00:00
|
|
|
|
2019-06-11 22:24:35 +00:00
|
|
|
describe "Inspec::Resources::OsEnv" do
|
|
|
|
it "verify env parsing" do
|
|
|
|
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
|
|
|
|
2019-06-11 22:24:35 +00:00
|
|
|
it "read env variable on Windows" do
|
|
|
|
resource = MockLoader.new(:windows).load_resource("os_env", "PATH")
|
2015-11-19 02:50:38 +00:00
|
|
|
_(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
|