Sha256: 4b51844af259421f5d0e4d086ea3bec4f394b0e65e2b2e1890dd2a9ca59e2149

Contents?: true

Size: 876 Bytes

Versions: 6

Compression:

Stored size: 876 Bytes

Contents

# Unit Testing Area for Example Plugins

## What Example Tests are Provided?

Here, since this is a CliCommand plugin, we provide two sets of unit tests:

 * plugin_def_test.rb - Would be useful in any plugin.  Verifies that the plugin is properly detected and registered.
 * cli_args_test.rb - Verifies that the expected commands are present, and that they have the expected options and args.

## What are Unit Tests?

Unit tests are tests that verify that the individual components of your plugin work as intended.  To be picked up by the Rake tasks as tests, each test file should end in `_test.rb`.

## Unit vs Functional Tests

A practical difference between unit tests and functional tests is that unit tests all run within one process, while functional tests might exercise a CLI plugin by shelling out to an inspec command in a subprocess, and examining the results.

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
inspec-core-2.3.10 examples/plugins/inspec-resource-lister/test/unit/README.md
inspec-2.3.10 examples/plugins/inspec-resource-lister/test/unit/README.md
inspec-core-2.3.5 examples/plugins/inspec-resource-lister/test/unit/README.md
inspec-2.3.5 examples/plugins/inspec-resource-lister/test/unit/README.md
inspec-core-2.3.4 examples/plugins/inspec-resource-lister/test/unit/README.md
inspec-2.3.4 examples/plugins/inspec-resource-lister/test/unit/README.md