mirror of
https://github.com/inspec/inspec
synced 2024-12-18 17:14:33 +00:00
2251270929
* Added CRAN resource to check R modules control 'cran-1' do impact 1.0 desc ' Ensure R module DBI is installed. ' describe cpan('DBI') do it { should be_installed } its('version') { should cmp >= '3.0' } end end Signed-off-by: Markus Grobelin <grobi@koppzu.de> * cran resource: made lint happy, added negative unit test, removed unused arg perl_lib_path Signed-off-by: Markus Grobelin <grobi@koppzu.de>
23 lines
721 B
Ruby
23 lines
721 B
Ruby
# encoding: utf-8
|
|
# author: Christoph Hartmann
|
|
# author: Dominik Richter
|
|
# author: Markus Grobelin
|
|
|
|
require 'helper'
|
|
require 'inspec/resource'
|
|
|
|
describe 'Inspec::Resources::Cran' do
|
|
it 'verify cran package detail parsing' do
|
|
resource = load_resource('cran', 'DBI')
|
|
pkg = {type: 'cran', name: 'DBI', version: '0.5.1', installed: true}
|
|
_(resource.installed?).must_equal true
|
|
_(resource.info).must_equal pkg
|
|
end
|
|
it 'verify info for non-installed packages' do
|
|
resource = load_resource('cran', 'DoesNotExist')
|
|
_(resource.installed?).must_equal false
|
|
_(resource.version).must_be_nil
|
|
_(resource.info[:name]).must_equal 'DoesNotExist'
|
|
_(resource.info[:type]).must_equal 'cran'
|
|
end
|
|
end
|