inspec/test/unit/mock/profiles
Clinton Wolfe fefa6c2ecd
Plugin Type: DSLs (#3557)
This PR adds 5 closely related plugin types, which allow a plugin to implement new DSL methods / keywords. The mechanism to activate the plugins are all very similar - basically, in a particular location in the code, `method_missing` is implemented, and is used to activate the particular type of DSL being requested.

4 of the DSL plugin types relate to code that could appear in a profile control file.

* outer_profile_dsl plugins allow you to extend the code in profile Ruby files that appear outside `control` or `describe` blocks.
* control_dsl plugins allow you to extend the code within `control` blocks.
* describe_dsl plugins allow you to extend the code within `describe` blocks.
* test_dsl plugins allow you to extend the code within `it`/`its` blocks.

Finally, the `resource_dsl` plugin allows you to extend the code used within custom resources.

Basic unit tests are provided to prove that the plugin types are properly defined.

A simple plugin fixture defining DSL hooks (based on favorite foods) is included, and is exercised through a set of functional tests.

The plugin developer docs are updated to describe the 5 DSLs.

*Note*: Implementing a plugin using any of the DSL plugin types is experimental.  The contexts that are exposed to the DSL methods are private and poorly documented. The InSpec project does not claim the APIs used by these plugin types are covered by SemVer.  Plugin authors are encouraged to pin tightly to the `inspec` gem in their gemspecs.

Motivation for this plugin comes from the desire to allow passionate community members to implement things like "2 out of 3" tests, example groups, improved serverspec compatibility, "they/their" and other "fluency" changes, as well as make it possible for future work by the InSpec team to be implemented as a core plugin, rather than a direct change to the main codebase.
2018-11-29 14:14:06 -05:00
..
archive-depends Various improvements to vendor command (#3286) 2018-09-06 23:28:08 -04:00
archived-profiles Fix profile vendoring on Windows (#3378) 2018-09-13 20:19:02 -04:00
attributes Add functional tests for nested attributes (#3157) 2018-06-26 07:48:20 -04:00
aws-profile Prevent resources from loading if supports check fails (#2665) 2018-02-16 15:15:53 -05:00
complete-metadata Add windows functional tests (#3385) 2018-09-12 18:04:16 -04:00
complete-profile Inspec 3.0 (#3512) 2018-10-15 18:25:27 -04:00
control_metadata Add support for multiple descriptions for controls (#3424) 2018-09-26 13:28:57 -04:00
dependencies Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
dsl_plugins Plugin Type: DSLs (#3557) 2018-11-29 14:14:06 -05:00
empty-metadata add profile tests (non-legacy) 2016-01-20 21:57:23 +01:00
exception-in-control Catch exceptions in control blocks and fail the control (#2987) 2018-04-26 15:44:16 -04:00
failures Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
filter_table FilterTable: allow Strings or Symbols as fields (#3481) 2018-10-17 09:29:58 -04:00
git-depends Fix the git fetcher to vendor correctly (#3097) 2018-05-31 13:53:14 -04:00
global_attributes Fix attribute with empty hash regression (#3454) 2018-10-02 22:57:25 -07:00
invalid-version update unit tests 2017-05-31 00:21:05 -05:00
invalid_attributes Implement InSpec global attributes (#3318) 2018-09-12 16:42:58 -04:00
library Add windows functional tests (#3385) 2018-09-12 18:04:16 -04:00
license-invalid update unit tests 2017-05-31 00:21:05 -05:00
license-proprietary Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
license-spdx update unit tests 2017-05-31 00:21:05 -05:00
local-depends Various improvements to vendor command (#3286) 2018-09-06 23:28:08 -04:00
only-if-os-nope Allow inspec check to ignore only_if (#2250) 2017-12-05 14:13:41 +01:00
profile-lock-insync ✓ adds additional checks for vendored profiles (#3362) 2018-10-25 14:44:29 -04:00
profile-lock-notrequired ✓ adds additional checks for vendored profiles (#3362) 2018-10-25 14:44:29 -04:00
profile-lock-outofsync ✓ adds additional checks for vendored profiles (#3362) 2018-10-25 14:44:29 -04:00
profile-lock-required ✓ adds additional checks for vendored profiles (#3362) 2018-10-25 14:44:29 -04:00
profile-support-skip Add windows functional tests (#3385) 2018-09-12 18:04:16 -04:00
profile-with-bad-metadata Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
profile-with-empty-attributes Fix error on empty attributes yaml (#3485) 2018-10-11 09:41:36 -04:00
profile-with-required-attributes Fix archive with required attributes (#3468) 2018-10-05 16:24:26 -04:00
profile-with-resource-exceptions Allow skipping/failing resources in FilterTable (#2349) 2017-11-29 07:32:40 -05:00
required_attributes Implement InSpec global attributes (#3318) 2018-09-12 16:42:58 -04:00
simple-inheritance fix inherited profile cli report 2016-09-04 18:28:01 +02:00
simple-metadata add profile tests (non-legacy) 2016-01-20 21:57:23 +01:00
skippy-controls Show skip_message and correct title 2016-09-23 07:47:21 +01:00
skippy-profile-os Convert legacy supports to their platform counterparts (#3333) 2018-08-30 09:11:55 -04:00
slash-in-name/not-allowed Issue warning during check if profile name contains slash (#2231) 2017-11-09 12:32:54 +01:00
spec_only introduce cli report formatter 2016-06-15 17:11:29 +02:00
supermarket-dep Provide inspec.yml shortcut syntax 2016-09-14 08:46:06 +02:00
supported_inspec Add platform resource and platform supports (#2393) 2018-01-02 11:04:13 -08:00
unsupported_dependencies Inspec 3.0 (#3512) 2018-10-15 18:25:27 -04:00
unsupported_inspec Inspec 3.0 (#3512) 2018-10-15 18:25:27 -04:00
warn_logs Prevent logs from showing up when running inspec json (#3391) 2018-09-13 13:05:10 -04:00
windows-only Remove any "All Rights Reserved" references (#1969) 2017-06-28 04:14:19 -07:00
wrapper-override Add support for multiple descriptions for controls (#3424) 2018-09-26 13:28:57 -04:00
wrong-char-profile enforce utf encoding for cli output (#3376) 2018-09-10 14:37:43 -04:00
{{special-path}} Modify DirProvider to allow special characters (#2174) 2017-09-23 09:16:25 +02:00