mirror of
https://github.com/inspec/inspec
synced 2024-11-30 08:30:39 +00:00
Merge pull request #1718 from chef/dr/expose-inspec
provide the `inspec` keyword
This commit is contained in:
commit
075336da54
2 changed files with 14 additions and 2 deletions
|
@ -48,6 +48,10 @@ module Inspec
|
||||||
r.new(backend, id.to_s, *args)
|
r.new(backend, id.to_s, *args)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
define_method :inspec do
|
||||||
|
backend
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,6 +10,14 @@ describe 'inspec keyword' do
|
||||||
res = runner.eval_with_virtual_profile(content)
|
res = runner.eval_with_virtual_profile(content)
|
||||||
end
|
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
|
it 'is associated with resources' do
|
||||||
i = load('os.inspec')
|
i = load('os.inspec')
|
||||||
i.wont_be_nil
|
i.wont_be_nil
|
||||||
|
@ -17,10 +25,10 @@ describe 'inspec keyword' do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'prints a nice to_s' do
|
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
|
end
|
||||||
|
|
||||||
it 'prints a nice inspect line' do
|
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
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue