Skip to content

Commit

Permalink
Merge pull request #27 from cheesesashimi/master
Browse files Browse the repository at this point in the history
Specify inspec output format from kitchen.yml
  • Loading branch information
chris-rock committed Dec 24, 2015
2 parents b6bb837 + 6a9ceec commit 9afb9d9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/kitchen/verifier/inspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def call(state)
" does not support the #{name} Transport",
)
end
runner_options['format'] = config[:format] unless config[:format].nil?

tests = helper_files + local_suite_files

runner = ::Inspec::Runner.new(runner_options)
Expand Down
14 changes: 14 additions & 0 deletions spec/kitchen/verifier/inspec_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,20 @@
verifier.call(port: 123)
end

it 'constructs an Inspec::Runner with a specified inspec output format' do
config[:format] = 'documentation'

expect(Inspec::Runner).to receive(:new)
.with(
hash_including(
'format' => 'documentation',
),
)
.and_return(runner)

verifier.call(port: 123)
end

it 'adds *spec.rb test files to runner' do
create_test_files
allow(Inspec::Runner).to receive(:new).and_return(runner)
Expand Down

0 comments on commit 9afb9d9

Please sign in to comment.