inspec/examples/custom-resource/libraries/gordon.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

21 lines
362 B
Ruby

class Gordon < Inspec.resource(1)
name 'gordon'
example "
describe gordon do
its('crime_rate') { should be < 2 }
it { should have_a_fabulous_mustache }
end
"
def crime_rate
# call out ot another custom resource
inspec.batsignal.number_of_sightings
end
def has_a_fabulous_mustache?
# always true
true
end
end