inspec/test/unit/resources/os_env_test.rb

16 lines
591 B
Ruby
Raw Normal View History

require "helper"
require "inspec/resource"
require "inspec/resources/os_env"
2015-09-05 18:09:04 +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
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