Save off supports[:os] and restore it after each test.

This fixes some other tests that require supports[:os] to be correct.

Signed-off-by: Ryan Davis <zenspider@chef.io>
This commit is contained in:
Ryan Davis 2019-08-27 17:30:03 -07:00
parent 6296fdc688
commit 6e821e787e

View file

@ -57,10 +57,15 @@ describe Inspec::Plugins::Resource do
describe "supported platform" do
def supports_meta(supports)
@old = Inspec::Resource.supports[:os]
Inspec::Resource.supports[:os] = supports
load_resource("os")
end
after do
Inspec::Resource.supports[:os] = @old
end
it "loads a profile which supports multiple families" do
m = supports_meta([
{ os_family: "windows" },