mirror of
https://github.com/inspec/inspec
synced 2024-11-23 13:13:22 +00:00
Update tests to use json-schema, and test something.
Signed-off-by: Miah Johnson <miah@chia-pet.org>
This commit is contained in:
parent
23245df6d1
commit
0aea548dd8
3 changed files with 8 additions and 9 deletions
|
@ -1,5 +1,4 @@
|
|||
require 'functional/helper'
|
||||
require 'jsonschema'
|
||||
require 'tmpdir'
|
||||
|
||||
describe 'inspec check' do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require 'functional/helper'
|
||||
require 'jsonschema'
|
||||
require 'json-schema'
|
||||
|
||||
describe 'inspec exec with json formatter' do
|
||||
include FunctionalHelper
|
||||
|
@ -11,7 +11,7 @@ describe 'inspec exec with json formatter' do
|
|||
data = JSON.parse(out.stdout)
|
||||
sout = inspec('schema exec-json')
|
||||
schema = JSON.parse(sout.stdout)
|
||||
JSON::Schema.validate(data, schema)
|
||||
JSON::Validator.validate(schema, data).wont_equal false
|
||||
end
|
||||
|
||||
it 'can execute a profile and validate the json schema' do
|
||||
|
@ -21,7 +21,7 @@ describe 'inspec exec with json formatter' do
|
|||
data = JSON.parse(out.stdout)
|
||||
sout = inspec('schema exec-json')
|
||||
schema = JSON.parse(sout.stdout)
|
||||
JSON::Schema.validate(data, schema)
|
||||
JSON::Validator.validate(schema, data).wont_equal false
|
||||
end
|
||||
|
||||
it 'can execute a simple file while using end of options after reporter cli option' do
|
||||
|
@ -31,7 +31,7 @@ describe 'inspec exec with json formatter' do
|
|||
data = JSON.parse(out.stdout)
|
||||
sout = inspec('schema exec-json')
|
||||
schema = JSON.parse(sout.stdout)
|
||||
JSON::Schema.validate(data, schema)
|
||||
JSON::Validator.validate(schema, data).wont_equal false
|
||||
end
|
||||
|
||||
it 'can execute a profile and validate the json schema with target_id' do
|
||||
|
@ -42,7 +42,7 @@ describe 'inspec exec with json formatter' do
|
|||
data['platform']['target_id'].must_equal '1d3e399f-4d71-4863-ac54-84d437fbc444'
|
||||
sout = inspec('schema exec-json')
|
||||
schema = JSON.parse(sout.stdout)
|
||||
JSON::Schema.validate(data, schema)
|
||||
JSON::Validator.validate(schema, data).wont_equal false
|
||||
end
|
||||
|
||||
it 'does not report skipped dependent profiles' do
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
require 'functional/helper'
|
||||
require 'jsonschema'
|
||||
require 'json-schema'
|
||||
|
||||
describe 'inspec exec' do
|
||||
include FunctionalHelper
|
||||
|
@ -11,7 +11,7 @@ describe 'inspec exec' do
|
|||
data = JSON.parse(out.stdout)
|
||||
sout = inspec('schema exec-jsonmin')
|
||||
schema = JSON.parse(sout.stdout)
|
||||
JSON::Schema.validate(data, schema)
|
||||
JSON::Validator.validate(schema, data).wont_equal false
|
||||
end
|
||||
|
||||
it 'can execute a simple file with the mini json formatter and validate its schema' do
|
||||
|
@ -21,7 +21,7 @@ describe 'inspec exec' do
|
|||
data = JSON.parse(out.stdout)
|
||||
sout = inspec('schema exec-jsonmin')
|
||||
schema = JSON.parse(sout.stdout)
|
||||
JSON::Schema.validate(data, schema)
|
||||
JSON::Validator.validate(schema, data).wont_equal false
|
||||
end
|
||||
|
||||
it 'does not contain any dupilcate results with describe.one' do
|
||||
|
|
Loading…
Reference in a new issue