Rename Inspec::Resource.supports to support_registry.

To fix an already existing name collision between Inspec::Resource and
Inspec::Plugins::Resource.

Signed-off-by: Ryan Davis <zenspider@chef.io>
This commit is contained in:
Ryan Davis 2019-12-30 14:47:47 -08:00
parent f0a5ddd4df
commit 44a006a05a
2 changed files with 8 additions and 8 deletions

View file

@ -16,8 +16,8 @@ module Inspec
end
# TODO: these are keyed off of symbols
def self.supports
@supports ||= {}
def self.support_registry
@support_registry ||= {}
end
def self.new_registry

View file

@ -57,13 +57,13 @@ describe Inspec::Plugins::Resource do
describe "supported platform" do
def supports_meta(supports)
@old = Inspec::Resource.supports[:os]
Inspec::Resource.supports[:os] = supports
@old = Inspec::Resource.support_registry[:os]
Inspec::Resource.support_registry[:os] = supports
load_resource("os")
end
after do
Inspec::Resource.supports[:os] = @old
Inspec::Resource.support_registry[:os] = @old
end
it "loads a profile which supports multiple families" do
@ -72,7 +72,7 @@ describe Inspec::Plugins::Resource do
{ os_family: "unix" },
])
_(m.check_supports).must_equal true
Inspec::Resource.supports["os"] = nil
Inspec::Resource.support_registry["os"] = nil
end
it "loads a profile which supports multiple names" do
@ -81,7 +81,7 @@ describe Inspec::Plugins::Resource do
{ os_family: "unix", os_name: "ubuntu" },
])
_(m.check_supports).must_equal true
Inspec::Resource.supports["os"] = nil
Inspec::Resource.support_registry["os"] = nil
end
it "reject a profile which supports multiple families" do
@ -90,7 +90,7 @@ describe Inspec::Plugins::Resource do
{ os_family: "redhat" },
])
_(m.check_supports).must_equal false
Inspec::Resource.supports["os"] = nil
Inspec::Resource.support_registry["os"] = nil
end
end
end