-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! [#139] Ignore build-related files
- Loading branch information
Showing
1 changed file
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/env bats | ||
|
||
# SPDX-FileCopyrightText: 2022 Serokell <https://serokell.io> | ||
# | ||
# SPDX-License-Identifier: MPL-2.0 | ||
|
||
load '../helpers/bats-support/load' | ||
load '../helpers/bats-assert/load' | ||
load '../helpers/bats-file/load' | ||
load '../helpers' | ||
|
||
@test "Git: not a repo" { | ||
cd $TEST_TEMP_DIR | ||
|
||
run xrefcheck | ||
|
||
assert_output --partial "fatal: not a git repository" | ||
} | ||
|
||
@test "Git: file not tracked" { | ||
cd $TEST_TEMP_DIR | ||
|
||
git init | ||
|
||
echo "[a](/a.md)" >> "git.md" | ||
|
||
run xrefcheck | ||
|
||
assert_output --partial "All repository links are valid." | ||
} | ||
|
||
@test "Git: file tracked, check failure" { | ||
cd $TEST_TEMP_DIR | ||
|
||
git init | ||
|
||
echo "[a](./a.md)" >> "git.md" | ||
|
||
git add git.md | ||
|
||
to_temp xrefcheck | ||
|
||
assert_diff - <<EOF | ||
=== Invalid references found === | ||
➥ In file git.md | ||
bad reference (relative) at src:1:1-11: | ||
- text: "a" | ||
- link: ./a.md | ||
- anchor: - | ||
⛀ File does not exist: | ||
a.md | ||
Invalid references dumped, 1 in total. | ||
EOF | ||
} |