inspec/test/unit
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
..
bundles/inspec-supermarket Move compliance to v2 plugin (#3423) 2018-10-04 14:31:39 -04:00
dependencies Add parent_profile field in json output (#3164) 2018-06-26 13:04:31 -04:00
dsl Allow add_test to accept negation (#3586) 2018-11-08 12:48:12 -05:00
fetchers Add Git SSH and HTTP basic auth support to inspec exec (#3562) 2018-11-08 15:55:15 -05:00
mock Plugin Type: DSLs (#3557) 2018-11-29 14:14:06 -05:00
objects Update the text on the generic default attribute (#3508) 2018-10-15 12:15:17 -04:00
plugin Plugin Type: DSLs (#3557) 2018-11-29 14:14:06 -05:00
profiles Inspec 3.0 (#3512) 2018-10-15 18:25:27 -04:00
reporters Add support for multiple descriptions for controls (#3424) 2018-09-26 13:28:57 -04:00
resource_supports/aws Capture ArgumentErrors from aws. (#2673) 2018-02-17 16:50:35 +01:00
resources Add aws_eks_cluster resource (#3582) 2018-11-27 16:54:47 -05:00
source_readers Inspec 3.0 (#3512) 2018-10-15 18:25:27 -04:00
utils nginx_conf resource: Fix include paths with quotes (#2726) 2018-05-03 09:53:20 -04:00
attribute_registry_test.rb Grammar correction in error message: use "an" with attribute and unknown (#3439) 2018-09-25 11:13:56 -04:00
base_cli_test.rb Inspec 3.0 (#3512) 2018-10-15 18:25:27 -04:00
cached_fetcher.rb Cached profiles with Compliance Fetcher (#3221) 2018-08-28 09:11:38 -04:00
file_provider_test.rb Adds protection against zipslip vulnerability (#3604) 2018-11-13 14:33:34 -05:00
helper.rb Rely on unit test helper to load resources, not individual AWS tests 2018-02-07 12:09:08 -05:00
impact_test.rb Add string impact options for controls (#3359) 2018-09-13 14:14:05 -04:00
runner_test.rb Update to safe navigation exit code skip search. (#3541) 2018-10-24 15:08:07 -04:00
shell_detector_test.rb Corrected some unit test warnings (#2242) 2017-10-17 14:49:26 +02:00