inspec/examples/custom-resource/libraries/batsignal.rb
Jared Quick 06e1aa5379 Allow custom resources to access all other resources (#3108)
Signed-off-by: Jared Quick <jquick@chef.io>
2018-06-06 11:56:51 -04:00

20 lines
343 B
Ruby

class Batsignal < Inspec.resource(1)
name 'batsignal'
example "
describe batsignal do
its('number_of_sightings)') { should eq '4' }
end
"
def number_of_sightings
local_command_call
end
private
def local_command_call
# call out to a core resource
inspec.command('echo 4').stdout.to_i
end
end