[x] make test-all (UNIX) passes. CI will also test this
[x] unit and/or integration tests are included (if applicable)
[x] documentation is changed or added (if applicable)
Description of change
Adds unified diff to the output when doing string comparison. For example:
$ cat test.txt
this is a file
containing
hello world
$ cat goss.yaml
file:
test.txt:
exists: true
mode: "0664"
owner: aelsabbahy
group: aelsabbahy
filetype: file
contents: |
this is a file
containing
goodbye world
$ goss v
.....F
Failures/Skipped:
File: test.txt: contents:
Expected
"this is a file\ncontaining\nhello world\n"
to equal
"this is a file\ncontaining\ngoodbye world\n"
diff
--- test
+++ actual
@@ -1,3 +1,3 @@
this is a file
containing
-goodbye world
+hello world
Total Duration: 0.000s
Count: 6, Failed: 1, Skipped: 0
The current implementation only does it for multi-line assertions, but I think that might be unnecessarily clever.. not sure.
For example, changing the above goss.yaml to only match one line will behave differently:
$ cat goss.yaml
file:
test.txt:
exists: true
mode: "0664"
owner: aelsabbahy
group: aelsabbahy
filetype: file
contents: |
goodbye world
$ goss v
.....F
Failures/Skipped:
File: test.txt: contents:
Expected
"this is a file\ncontaining\nhello world\n"
to equal
"goodbye world\n"
Total Duration: 0.000s
Count: 6, Failed: 1, Skipped: 0
Checklist
make test-all
(UNIX) passes. CI will also test thisDescription of change
Adds unified diff to the output when doing string comparison. For example:
The current implementation only does it for multi-line assertions, but I think that might be unnecessarily clever.. not sure.
For example, changing the above goss.yaml to only match one line will behave differently: