mirror of
https://github.com/inspec/inspec
synced 2024-11-30 16:39:20 +00:00
1b0eaf765f
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
20 lines
748 B
Ruby
20 lines
748 B
Ruby
require "helper"
|
|
require "inspec/resource"
|
|
require "inspec/resources/os_env"
|
|
|
|
describe "Inspec::Resources::OsEnv" do
|
|
it "generates the resource_id for current_resource" do
|
|
resource = load_resource("os_env", "PATH")
|
|
_(resource.resource_id).must_equal "PATH"
|
|
end
|
|
|
|
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
|