Use the cran Chef InSpec audit resource to test R modules that are installed from CRAN package repository.
This resource is distributed along with Chef InSpec itself. You can use it automatically.
This resource first became available in v1.43.5 of InSpec.
A cran resource block declares a package and (optionally) a package version:
describe cran('package_name') do
it { should be_installed }
end
where
'package_name' is the name of the package, such as 'DBI'
be_installed tests to see if the package described above is installedThe following examples show how to use this Chef InSpec audit resource.
describe cran('DBI') do
it { should be_installed }
end
describe cran('DBI') do
it { should be_installed }
its('version') { should eq '0.5.1' }
end
The version property tests if the named package version is on the system:
its('version') { should eq '1.2.3' }
This Chef InSpec audit resource has the following matchers:
The be_installed matcher tests if the named package is installed on the system:
it { should be_installed }
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/cran/