mirror of
https://github.com/inspec/inspec
synced 2024-11-27 15:10:44 +00:00
Updates cran resource doc (#2512)
Signed-off-by: kagarmoe <kgarmoe@chef.io>
This commit is contained in:
parent
d3a2957766
commit
3e7e806eba
1 changed files with 27 additions and 18 deletions
|
@ -6,6 +6,8 @@ title: About the cran Resource
|
||||||
|
|
||||||
Use the `cran` InSpec audit resource to test R modules that are installed from CRAN package repository.
|
Use the `cran` InSpec audit resource to test R modules that are installed from CRAN package repository.
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
## Syntax
|
## Syntax
|
||||||
|
|
||||||
A `cran` resource block declares a package and (optionally) a package version:
|
A `cran` resource block declares a package and (optionally) a package version:
|
||||||
|
@ -19,24 +21,9 @@ where
|
||||||
* `'package_name'` is the name of the package, such as `'DBI'`
|
* `'package_name'` is the name of the package, such as `'DBI'`
|
||||||
* `be_installed` tests to see if the package described above is installed
|
* `be_installed` tests to see if the package described above is installed
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
## Matchers
|
## Resource Parameter Examples
|
||||||
|
|
||||||
This InSpec audit resource has the following matchers:
|
|
||||||
|
|
||||||
### be_installed
|
|
||||||
|
|
||||||
The `be_installed` matcher tests if the named package is installed on the system:
|
|
||||||
|
|
||||||
it { should be_installed }
|
|
||||||
|
|
||||||
### version
|
|
||||||
|
|
||||||
The `version` matcher tests if the named package version is on the system:
|
|
||||||
|
|
||||||
its('version') { should eq '1.2.3' }
|
|
||||||
|
|
||||||
## Examples
|
|
||||||
|
|
||||||
The following examples show how to use this InSpec audit resource.
|
The following examples show how to use this InSpec audit resource.
|
||||||
|
|
||||||
|
@ -52,3 +39,25 @@ The following examples show how to use this InSpec audit resource.
|
||||||
it { should be_installed }
|
it { should be_installed }
|
||||||
its('version') { should eq '0.5.1' }
|
its('version') { should eq '0.5.1' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
## Property Examples
|
||||||
|
|
||||||
|
### version
|
||||||
|
|
||||||
|
The `version` property tests if the named package version is on the system:
|
||||||
|
|
||||||
|
its('version') { should eq '1.2.3' }
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
## Matchers
|
||||||
|
|
||||||
|
This InSpec audit resource has the following matchers:
|
||||||
|
|
||||||
|
### be_installed
|
||||||
|
|
||||||
|
The `be_installed` matcher tests if the named package is installed on the system:
|
||||||
|
|
||||||
|
it { should be_installed }
|
||||||
|
|
Loading…
Reference in a new issue