Skip to content

Commit

Permalink
Add example and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
glesica committed Oct 21, 2020
1 parent 2a616dc commit 5b1bcbb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ For more information take a look at the [quick start](#quick-start), the [exampl
* [line-count](#line-count)
* [not-contains](#not-contains)
* [xml](#xml)
* [file](#file)
- [stderr](#stderr)
- [skip](#skip)
+ [Config](#user-content-config-config)
Expand Down Expand Up @@ -530,6 +531,21 @@ cat some.xml:
</book>
```

##### file

`file` is a file path, relative to the working directory that will have
its entire contents matched against the command output. Other than
reading from a file this works the same as [exactly](#exactly).

The example below will always pass.

```yaml
output should match file:
command: cat output.txt
stdout:
file: output.txt
```

#### stderr

See [stdout](#stdout) for more information.
Expand Down
2 changes: 2 additions & 0 deletions examples/_fixtures/output.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
line one
line two
7 changes: 6 additions & 1 deletion examples/commander.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,9 @@ tests:
it should skip:
command: echo "I should be skipped"
stdout: I should be skipped
skip: true
skip: true

it should match file output:
command: printf "line one\nline two"
stdout:
file: _fixtures/output.txt

0 comments on commit 5b1bcbb

Please sign in to comment.