Commit Graph

2 Commits

Author SHA1 Message Date
Sergey Gulin
95d5bad3cd
[#133] Refactor golden tests
Problem: We're using a common pattern in our bats tests:
  Run xrefcheck, redirect output to a temp file
  Check the temp file matches some .gold file using `diff`
  Delete temp file
We could encapsulate this pattern and make it easier to reuse.

Solution: In the `setup` function, create a temp directory. In the
`teardown` function, delete the temp directory. Create a `to_temp`
function that runs xrefcheck with desired options, pipes its output
through the `prepare` helper function and saves it in a file inside
the temp directory. Create a `assert_diff` function that reads the temp
file, and uses `diff` to compare it against some expected output.
2022-09-24 23:47:24 +10:00
Andrey Demidenko
29d4f12c61
[#81] Add config option for localhost links
Problem:
Almost all the time we can't validate localhost links, so we just skip them.
But to run ftp links tests (#47) we need to refer to localhost.

Solution:
Add config option whether to ignore localhost links and provide bats
tests for this new feature.

Co-authored-by: Alexander Bantyev <alexander.bantyev@serokell.io>
2021-10-08 13:29:19 +03:00