mirror of
https://github.com/inspec/inspec
synced 2024-09-21 15:02:01 +00:00
Add examples
Signed-off-by: Jere Julian <jere@arista.com>
This commit is contained in:
parent
d855b5e7a7
commit
a2dd8fe791
1 changed files with 10 additions and 1 deletions
|
@ -12,6 +12,15 @@ module Inspec::Resources
|
|||
describe json('policyfile.lock.json') do
|
||||
its(['cookbook_locks','omnibus','version']) { should eq('2.2.0') }
|
||||
end
|
||||
|
||||
describe json({ command: 'curl -i -H \"Accept: application/json\" url' }) do
|
||||
its('state') { should eq('open') }
|
||||
end
|
||||
|
||||
describe json({ content: '{\"item1\": { \"status\": \"available\" } }' }) do
|
||||
its(['item1', 'status']) { should cmp 'available' }
|
||||
end
|
||||
|
||||
"
|
||||
|
||||
include ObjectTraverser
|
||||
|
@ -71,7 +80,7 @@ module Inspec::Resources
|
|||
|
||||
def to_s
|
||||
if @path.is_a?(Hash) && @path.key?(:content)
|
||||
"Json content"
|
||||
'Json content'
|
||||
else
|
||||
"Json #{@path}"
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue