2019-06-11 22:24:35 +00:00
|
|
|
require "helper"
|
|
|
|
require "inspec/resource"
|
|
|
|
require "inspec/resources/windows_hotfix"
|
2017-09-25 17:09:22 +00:00
|
|
|
|
2019-06-11 22:24:35 +00:00
|
|
|
describe "Inspec::Resources::WindowsHotfix" do
|
2017-09-25 17:09:22 +00:00
|
|
|
|
|
|
|
# ubuntu 14.04
|
2019-06-11 22:24:35 +00:00
|
|
|
it "fail windows_hotfix fails on ubuntu" do
|
2021-09-30 08:56:43 +00:00
|
|
|
resource = MockLoader.new(:ubuntu).load_resource("windows_hotfix", "KB4019215")
|
2017-09-25 17:09:22 +00:00
|
|
|
_(resource.installed?).must_equal false
|
|
|
|
end
|
|
|
|
|
|
|
|
# windows
|
2022-06-03 06:42:00 +00:00
|
|
|
it "generates the resource_id for the current resource" do
|
|
|
|
resource = MockLoader.new(:windows).load_resource("windows_hotfix", "KB4019215")
|
|
|
|
_(resource.resource_id).must_equal "KB4019215"
|
|
|
|
end
|
|
|
|
|
2019-06-11 22:24:35 +00:00
|
|
|
it "verify windows_hotfix installed on windows" do
|
|
|
|
resource = MockLoader.new(:windows).load_resource("windows_hotfix", "KB4019215")
|
2017-09-25 17:09:22 +00:00
|
|
|
_(resource.installed?).must_equal true
|
|
|
|
end
|
|
|
|
|
|
|
|
# windows missing hotfix
|
2019-06-11 22:24:35 +00:00
|
|
|
it "verify windows_hotfix not installed on windows" do
|
|
|
|
resource = MockLoader.new(:windows).load_resource("windows_hotfix", "KB9999999")
|
2017-09-25 17:09:22 +00:00
|
|
|
_(resource.installed?).must_equal false
|
|
|
|
end
|
|
|
|
end
|