1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 20:15:07 +00:00

feat: show nightly channel in version output

Refs #517
This commit is contained in:
tw93
2026-03-02 10:54:44 +08:00
parent 0a8f92cf83
commit 27a2cc5927
3 changed files with 83 additions and 0 deletions

View File

@@ -14,6 +14,7 @@ setup_file() {
}
teardown_file() {
rm -f "$PROJECT_ROOT/install_channel"
rm -rf "$HOME"
if [[ -n "${ORIGINAL_HOME:-}" ]]; then
export HOME="$ORIGINAL_HOME"
@@ -47,6 +48,7 @@ SCRIPT
setup() {
rm -rf "$HOME/.config"
mkdir -p "$HOME"
rm -f "$PROJECT_ROOT/install_channel"
}
@test "mole --help prints command overview" {
@@ -63,6 +65,18 @@ setup() {
[[ "$output" == *"$expected_version"* ]]
}
@test "mole --version shows nightly channel metadata" {
expected_version="$(grep '^VERSION=' "$PROJECT_ROOT/mole" | head -1 | sed 's/VERSION=\"\(.*\)\"/\1/')"
cat > "$PROJECT_ROOT/install_channel" <<'EOF'
CHANNEL=nightly
EOF
run env HOME="$HOME" "$PROJECT_ROOT/mole" --version
[ "$status" -eq 0 ]
[[ "$output" == *"Mole version $expected_version"* ]]
[[ "$output" == *"Channel: Nightly"* ]]
}
@test "mole unknown command returns error" {
run env HOME="$HOME" "$PROJECT_ROOT/mole" unknown-command
[ "$status" -ne 0 ]