Skip to content

Commit

Permalink
README.md: Document how to use voxpupuli-test
Browse files Browse the repository at this point in the history
This got extracted from voxpupuli/.github#1
  • Loading branch information
bastelfreak committed Sep 6, 2024
1 parent e016cca commit 204f1ba
Showing 1 changed file with 46 additions and 1 deletion.
47 changes: 46 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
[![RubyGem Version](https://img.shields.io/gem/v/voxpupuli-test.svg)](https://rubygems.org/gems/voxpupuli-test)
[![RubyGem Downloads](https://img.shields.io/gem/dt/voxpupuli-test.svg)](https://rubygems.org/gems/voxpupuli-test)

This is a helper Gem to test the various Vox Pupuli Puppet modules. This Gem provides common functionality for rspec-puppet based testing. The aim is to reduce the boiler plate and need for modulesync.
This is a helper Gem to test the various Vox Pupuli Puppet modules.
This Gem provides common functionality for rspec-puppet based testing and static code analysis.
The aim is to reduce the boiler plate and need for modulesync.

## Usage

Expand Down Expand Up @@ -36,6 +38,49 @@ inherit_gem:
voxpupuli-test: rubocop.yml
```
To run the linter, the syntax checker and the unit tests:
```sh
bundle exec rake test
```
To run your all the unit tests
```sh
bundle exec rake spec
```
To run a specific spec test set the `SPEC` variable:

```sh
SPEC=spec/classes/foo_spec.rb bundle exec rake spec
```
Or:
```sh
bundle exec srspec spec/classes/foo_spec.rb
```

To run all the static code analysis and linting:

```sh
bundle exec rake validate lint check rubocop
```


To autocorrect Puppet files:

```sh
bundle exec rake lint_fix
```

To autocorrect Ruby files:

```sh
bundle exec rake rubocop:autocorrect
```

## Rake tasks

### `check:trailing_whitespace`
Expand Down

0 comments on commit 204f1ba

Please sign in to comment.