mirror of
https://github.com/inspec/inspec
synced 2025-02-17 06:28:40 +00:00
Fixed a bug in checking supports (strings vs symbols)
Signed-off-by: Ryan Davis <zenspider@chef.io>
This commit is contained in:
parent
3f0f675364
commit
3b69967cc8
2 changed files with 6 additions and 4 deletions
|
@ -31,8 +31,10 @@ module Inspec
|
|||
def supports(criteria = nil)
|
||||
return if criteria.nil?
|
||||
|
||||
Inspec::Resource.supports[@name] ||= []
|
||||
Inspec::Resource.supports[@name].push(criteria)
|
||||
key = @name.to_sym
|
||||
|
||||
Inspec::Resource.supports[key] ||= []
|
||||
Inspec::Resource.supports[key].push(criteria)
|
||||
end
|
||||
|
||||
def example(example = nil)
|
||||
|
@ -80,7 +82,7 @@ module Inspec
|
|||
def initialize(backend, name, *args)
|
||||
@resource_skipped = false
|
||||
@resource_failed = false
|
||||
@supports = Inspec::Resource.supports[name]
|
||||
@supports = Inspec::Resource.supports[name.to_sym]
|
||||
@resource_exception_message = nil
|
||||
|
||||
# attach the backend to this instance
|
||||
|
|
|
@ -57,7 +57,7 @@ describe Inspec::Plugins::Resource do
|
|||
|
||||
describe "supported platform" do
|
||||
def supports_meta(supports)
|
||||
Inspec::Resource.supports["os"] = supports
|
||||
Inspec::Resource.supports[:os] = supports
|
||||
load_resource("os")
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue