Skip to content

Commit

Permalink
Add var node_facts to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Laura Macchi committed Feb 23, 2018
1 parent b2fe56d commit 0819a48
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,14 @@ In the example below we have referred to `centos6a` and `centos7b` in all of our
- **type** *statement or rvalue*
- **returns** *Optional: A value to return*

**before and after conditions** We can set before and after blocks before each spec test. Each before or after block accepts a condition.
**before and after conditions** We can set before and after blocks before each spec test. Each before or after block accepts a condition. The facts of a node
are available through the `node_facts` hash.
```yaml
before:
- "Puppet::Util::Platform.stubs(:'windows?').returns(:facts['kernel'] == 'windows')"
- "Puppet::Util::Platform.stubs(:'windows?').returns(node_facts['kernel'] == 'windows')"

after:
- "echo 'Test finished running'
- "puts 'Test finished running'"
```
**opts** The `opts` section overrides defaults for the `Onceover::Controlrepo` class' `opts` hash.
Expand Down

0 comments on commit 0819a48

Please sign in to comment.