Merge pull request #1718 from chef/dr/expose-inspec

provide the `inspec` keyword
This commit is contained in:
Christoph Hartmann 2017-04-26 13:03:30 +02:00 committed by GitHub
commit 075336da54
2 changed files with 14 additions and 2 deletions

View file

@ -48,6 +48,10 @@ module Inspec
r.new(backend, id.to_s, *args)
end
end
define_method :inspec do
backend
end
end
end
end

View file

@ -10,6 +10,14 @@ describe 'inspec keyword' do
res = runner.eval_with_virtual_profile(content)
end
it 'is a vailable as a global keyword' do
load('inspec') # wont raise anything
end
it 'is a vailable inside of control blocks' do
load('control 1 do inspec end') # wont raise anything
end
it 'is associated with resources' do
i = load('os.inspec')
i.wont_be_nil
@ -17,10 +25,10 @@ describe 'inspec keyword' do
end
it 'prints a nice to_s' do
load('os.inspec').to_s.must_equal 'Inspec::Backend::Class'
load('inspec').to_s.must_equal 'Inspec::Backend::Class'
end
it 'prints a nice inspect line' do
load('os.inspec').inspect.must_equal 'Inspec::Backend::Class @transport=Train::Transports::Mock::Connection'
load('inspec').inspect.must_equal 'Inspec::Backend::Class @transport=Train::Transports::Mock::Connection'
end
end