mirror of
https://github.com/inspec/inspec
synced 2024-11-23 05:03:07 +00:00
provide inspec.version
information
as a friendly shortcut and a native call within profiles Signed-off-by: Dominik Richter <dominik.richter@gmail.com>
This commit is contained in:
parent
075336da54
commit
8e5fbb9e02
2 changed files with 11 additions and 0 deletions
|
@ -36,6 +36,13 @@ module Inspec
|
|||
"Inspec::Backend::Class @transport=#{backend.class}"
|
||||
end
|
||||
|
||||
# Provide a shorthand to retrieve the inspec version from within a profile
|
||||
#
|
||||
# @return [String] inspec version
|
||||
def version
|
||||
Inspec::VERSION
|
||||
end
|
||||
|
||||
define_method :backend do
|
||||
connection
|
||||
end
|
||||
|
|
|
@ -18,6 +18,10 @@ describe 'inspec keyword' do
|
|||
load('control 1 do inspec end') # wont raise anything
|
||||
end
|
||||
|
||||
it 'provides version information' do
|
||||
load('inspec.version').must_equal Inspec::VERSION
|
||||
end
|
||||
|
||||
it 'is associated with resources' do
|
||||
i = load('os.inspec')
|
||||
i.wont_be_nil
|
||||
|
|
Loading…
Reference in a new issue