inspec/test/unit
David Alexander 6ed4068fd1 Extend Windows ACL matchers (#1744)
* Adds alias for 'ListDirectory' permission

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* Works with Ruby array of permissions as long as possible

Converts to PowerShell array just before use.

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* Abstracts user-provided permissions to router method

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* Adds FullControl as a specifiable permission

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* Adds specific permission 'modify'

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* Fixes #1743

Limits Windows' broad "read" permission to if it can read all of the
above, instead of just the first:

- File contents
- File attributes
- File extended attributes
- File permissions

This better aligns with how Windows names the permissions.

  'read' -> Read instead of 'read' -> ReadData

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* 'Execute' Windows ACL has alias of 'Traverse'

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* Adds 'Delete' permission

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* Adds `should allow('perm').by_user('me')` matcher

Provides hooks for later use with Windows ACL matching

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* Adds remaining Windows ACL hooks

Skips ReadAndExecute on intentionally since it just aliases the combo of
2 permissions into one new one.

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* [Rubocop] Reduces ABC / Cyclomatic complexity

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* Reduces global scope with `allows()` -> `be_allowed()`

RSpec inferred matchers work nicely here. This changes the `by_user()`
and `by()` chained matchers to just be an options hash on the underlying
`allowed?()` method.

Signed-off-by: David Alexander <opensource@thelonelyghost.com>

* Fixes integration tests with rename `allows()` -> `be_allowed()`

Signed-off-by: David Alexander <opensource@thelonelyghost.com>
2017-10-17 15:01:51 +02:00
..
bundles Support profile versions for automate profiles storage (#2128) 2017-09-13 16:53:36 -04:00
dependencies Bump lockfile version to 1.0 2016-09-26 09:51:04 +01:00
dsl New 'be_in' matcher for matching against values in a list (#2022) 2017-08-07 16:05:22 +02:00
fetchers Don't send HTTP headers that have nil values (#1948) 2017-06-21 19:09:13 -05:00
mock Fix port ressource ss line parsing (#2243) 2017-10-17 14:45:37 +02:00
objects forgiving default attributes (#2177) 2017-09-22 08:57:51 -04:00
plugins Remove some warnings during the test run 2016-09-09 14:14:36 +01:00
profiles Fix only_if behavior when used outside controls (#2216) 2017-10-17 14:47:30 +02:00
resources Extend Windows ACL matchers (#1744) 2017-10-17 15:01:51 +02:00
source_readers Source reader should not hand back files with nil contents (#2003) 2017-07-11 21:33:55 +02:00
utils Corrected some unit test warnings (#2242) 2017-10-17 14:49:26 +02:00
file_provider_test.rb Support PAX-formatted tar files, standardize file lists (#2225) 2017-10-10 10:36:57 +01:00
runner_test.rb Add attributes file readability error handling (#2127) 2017-09-08 08:43:33 -04:00
shell_detector_test.rb Corrected some unit test warnings (#2242) 2017-10-17 14:49:26 +02:00