mirror of
https://github.com/inspec/inspec
synced 2024-11-23 05:03:07 +00:00
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:
parent
f0a5ddd4df
commit
44a006a05a
2 changed files with 8 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue