* Unit and functional tests for a reject list facility
* Implementation of plugin reject facility
* Initial draft of reject list
* Add option to search to hide test fixture by default
* Fix test
* PR feedback
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* updates the AlpinePkg class `info` method to use the `delete_if` method as the `reject!` method was returning nil.
Signed-off-by: Aaron Lippold <lippold@gmail.com>
* Move compliance pluging to v2 system.
* Update kitchen-inspec to test.
* Add legacy require patsh.
* Fix unit test
Signed-off-by: Jared Quick <jquick@chef.io>
For larger processes, Busybox's ps displays the vsz and rss columns in
megabytes or gigabytes, with no option I've found to override the behavior.
This change updates the process regex to account for that and converts
the values to kilobytes so they can still be cast as integers.
Signed-off-by: Jonathan Hartman <j@hartman.io>
The description for `distinct_exit` had the exit codes backwards.
From the long desc
> If some tests skipped but none failed, exit code 101 is returned. If at least one test failed, exit code 100 is returned.
Signed-off-by: Will Fisher <wfisher@chef.io>
This modifies the output of failed test when using the `cmp` matcher by
calling `.inspect` on the actual value passed.
This makes it easier to diagnose failed matches due to characters such
as `\n` not being visible.
Current behavior:
```
inspec> describe command('echo demo') do
inspec> its('stdout') { should cmp 'demo' }
inspec> end
Profile: inspec-shell
Version: (not specified)
Command: `echo demo`
× stdout should cmp == "demo"
expected: "demo"
got: demo
(compared using `cmp` matcher)
Test Summary: 0 successful, 1 failure, 0 skipped
```
New behavior:
```
inspec> describe command('echo demo') do
inspec> its('stdout') { should cmp 'demo' }
inspec> end
Profile: inspec-shell
Version: (not specified)
Command: `echo demo`
× stdout should cmp == "demo"
expected: "demo"
got: "demo\n"
(compared using `cmp` matcher)
Test Summary: 0 successful, 1 failure, 0 skipped
```
Many thanks to @jazaval for discovering this!
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
* Unit tests passing for loading Train plugins
* detect works with a train test fixture
* Update fixture install of train-fixture-plugin
* Add functional tests for detect and shell when talking to a train plugin backend
* Update docs to reflect availability of Train plugins
* Functional test for install train plugin from path
* Working install train plugin from path, more tests for installing from odd locations
* PR Feedback
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Plugin example, CLI resource lister
* Move example plugin into a directory to look like a regular project
* Skeleton of testing for example plugin
* Example plugin unit tests work
* Functional tests added, using core helper
* Add a global method to determine InSpec install root
* Add linter support to the example
* Adjust inspec project rubocop to run linter on example plugins
* Linter autocorrections
* Update readme
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
* Add support for multiple descriptions for controls
This adds the ability to specify multiple descriptions in controls.
Example:
```ruby
control 'my-control' do
impact 1.0
title 'My control'
desc 'A default description'
desc 'rational', 'I need an example'
describe file('/tmp') do
it { should be_directory }
end
end
```
Many thanks to @jquick for helping me with the unit tests.
* Remove unused `descriptions` method
* Remove unused profile from test mocks
* Respond to feedback
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
* Functional test for usage messaging
* Activate v2 commands on empty CLI invocation for usage messaging
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>