inspec/test/unit
Miah Johnson 75f39e74f2 Refine deprecated methods to be consisten with supported fields in (#2801)
shadow file.

After much thought the deprecations from #2642 were for the wrong methods.

Plural method names feel much more natural when working with this
resource because you can have more than a single result.

Consider a match like `shadow.user(/^www/)`, this could return multiple
users, so `shadow.users` feels more natural here.

The problem is that the fields we're matching in the shadow file itself
are singular. Each entry is for a user, which has a password, and some
other fields. A user never has `passwords` in the shadow file, only a
`password`.

This is made more obvious when you use the `filter` method.

When we use this filter: `shadow.filter(min_days: 20, max_days: 30)` we
are matching fields in the shadow file and not using our matcher
methods. This means that if there is a discrepancy between our matcher
methods, and the shadow fields the user could end up confused. Like I did =)

This PR changes:

Changed matchers to match shadow fields.
Updated documentation to reflect changes.
Updated tests to reflect changes.
Re-add `filter` method, and add a test for it.
Renamed variable for FilterTable to be less confusing.
Renamed query argument for methods to be consistent.
Cleanup docs based on comments from @jerryaldrichiii
Make Rubocop happy <3

Signed-off-by: Miah Johnson <miah@chia-pet.org>
2018-03-08 17:26:08 -05:00
..
bundles Fix OWCA detection for compliance login (#2401) 2017-12-22 15:01:18 +01:00
dependencies Properly compare profile version strings as SemVer (#2280) 2017-11-09 12:29:41 +01:00
dsl Add new "reporter" system (replacement for "formatters"), support multiple reporters per run (#2464) 2018-02-08 10:06:58 +01:00
fetchers Don't send HTTP headers that have nil values (#1948) 2017-06-21 19:09:13 -05:00
mock Host resource: use bash over netcat in Linux (#2607) 2018-03-07 08:39:27 -05:00
objects bugfix: default attributes for nil and false (#2410) 2017-12-21 14:20:59 +01:00
plugins Prevent resources from loading if supports check fails (#2665) 2018-02-16 15:15:53 -05:00
profiles Remove deprecations for InSpec 2.0 (#2506) 2018-02-08 11:05:21 +01:00
reporters Update reporter with breaking inspec 2.0 changes. (#2487) 2018-02-14 11:54:20 -05:00
resource_supports/aws Capture ArgumentErrors from aws. (#2673) 2018-02-17 16:50:35 +01:00
resources Refine deprecated methods to be consisten with supported fields in (#2801) 2018-03-08 17:26:08 -05:00
source_readers Source reader should not hand back files with nil contents (#2003) 2017-07-11 21:33:55 +02:00
utils mssql_session - Handling cases where the data is nil (#2752) 2018-03-01 14:30:07 -05:00
base_cli_test.rb Update shell detect to work with platforms (#2712) 2018-02-20 07:37:23 -05:00
file_provider_test.rb Remove meaningless stdout message (#2313) 2017-11-17 15:56:36 -05:00
helper.rb Rely on unit test helper to load resources, not individual AWS tests 2018-02-07 12:09:08 -05:00
runner_test.rb Allow ad-hoc runners to use rspec formats. (#2621) 2018-02-12 19:29:54 +01:00
shell_detector_test.rb Corrected some unit test warnings (#2242) 2017-10-17 14:49:26 +02:00