We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The json inspec resource not working with '.' as separators.
$ bin/inspec version 0.18.0
OS X 10.11.3
With the following json file:
{ "cookbook_locks": { "omnibus": { "version": "2.2.0", "identifier": "22b35f3f9273cb8d8b6ac3684cb92f960597ff2f" } } }
The json inspec resource documentation and example show this:
describe json('policyfile.lock.json') do its('cookbook_locks.omnibus.version') { should eq('2.2.0') } end
On execution, it gives this error message:
$ bin/inspec exec /tmp/json_test.rb F Failures: 1) Json /tmp/Policyfile.lock.json cookbook_locks.omnibus.version Failure/Error: with.run_specs(tests) NoMethodError: undefined method `omnibus' for #<Hash:0x007f8a62c817b8> # /tmp/json_test.rb:2:in `block (2 levels) in load' # ./lib/inspec/runner_rspec.rb:67:in `run' # ./lib/utils/base_cli.rb:70:in `run_tests' # ./lib/inspec/cli.rb:113:in `exec' Finished in 0.00093 seconds (files took 1.06 seconds to load) 1 example, 1 failure Failed examples: rspec # Json /tmp/Policyfile.lock.json cookbook_locks.omnibus.version
The workaround I found was to run it like this:
describe json('/tmp/Policyfile.lock.json') do its(['cookbook_locks','omnibus','version']) { should eq('2.2.0') } end
producing the correct output:
$ bin/inspec exec /tmp/json_test.rb . Finished in 0.00086 seconds (files took 1.01 seconds to load) 1 example, 0 failures
The text was updated successfully, but these errors were encountered:
Unfortunately, this is an issue with its. We need to update the documentation for the resource to use:
its
for now
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Description
The json inspec resource not working with '.' as separators.
InSpec and Platform Version
OS X 10.11.3
Replication Case
With the following json file:
The json inspec resource documentation and example show this:
On execution, it gives this error message:
The workaround I found was to run it like this:
producing the correct output:
The text was updated successfully, but these errors were encountered: