inspec/test/unit/resources/sys_info_test.rb

23 lines
744 B
Ruby
Raw Normal View History

require "helper"
require "inspec/resource"
require "inspec/resources/sys_info"
2016-09-09 08:30:41 +00:00
describe "Inspec::Resources::SysInfo" do
describe "sys_info" do
it "check sys_info.hostname on Ubuntu" do
resource = MockLoader.new(:ubuntu1504).load_resource("sys_info")
_(resource.hostname).must_equal "example.com"
2016-09-09 08:30:41 +00:00
end
it "check sys_info.hostname on Windows" do
resource = MockLoader.new(:windows).load_resource("sys_info")
_(resource.hostname).must_equal "WIN-CIV7VMLVHLD"
2016-09-09 08:30:41 +00:00
end
it "check sysinfo.hostname on freebsd" do
resource = MockLoader.new(:freebsd10).load_resource("sys_info")
_(resource.hostname).must_equal "The `sys_info.hostname` resource is not supported on your OS yet."
2016-09-09 08:30:41 +00:00
end
end
end