forked from get-gah/gah
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path03_test_release_odin.bats
More file actions
70 lines (54 loc) · 1.79 KB
/
03_test_release_odin.bats
File metadata and controls
70 lines (54 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
load "test_helper/bats-support/load"
load "test_helper/bats-assert/load"
load "test_helper/bats-mock/stub"
load "test_helper/common"
load "$DIR/gah"
setup() {
common_setup
}
teardown() {
common_teardown
if [[ -n "$TEST_TEMP_DIR" && -d "$TEST_TEMP_DIR" ]]; then
rm -rf "$TEST_TEMP_DIR"
TEST_TEMP_DIR=""
fi
unstub uname || true
unstub curl || true
unstub wget || true
}
@test "find_download_url should print match for the correct asset [linux/amd64]" {
stub uname \
"-s : echo 'Linux'" \
"-m : echo 'x86_64'"
DEBUG=""
run find_download_url "$DIR/test/fixtures/releases/odin/release.json"
assert_success
assert_output "https://github.com/odin-lang/Odin/releases/download/dev-2025-09/odin-linux-amd64-dev-2025-09.zip"
}
@test "find_download_url should print match for the correct asset [linux/arm64]" {
stub uname \
"-s : echo 'Linux'" \
"-m : echo 'aarch64'"
DEBUG=""
run find_download_url "$DIR/test/fixtures/releases/odin/release.json"
assert_success
assert_output "https://github.com/odin-lang/Odin/releases/download/dev-2025-09/odin-linux-arm64-dev-2025-09.zip"
}
@test "find_download_url should print match for the correct asset [macos/amd64]" {
stub uname \
"-s : echo 'Darwin'" \
"-m : echo 'x86_64'"
DEBUG=""
run find_download_url "$DIR/test/fixtures/releases/odin/release.json"
assert_success
assert_output "https://github.com/odin-lang/Odin/releases/download/dev-2025-09/odin-macos-amd64-dev-2025-09.zip"
}
@test "find_download_url should print match for the correct asset [macos/arm64]" {
stub uname \
"-s : echo 'Darwin'" \
"-m : echo 'aarch64'"
DEBUG=""
run find_download_url "$DIR/test/fixtures/releases/odin/release.json"
assert_success
assert_output "https://github.com/odin-lang/Odin/releases/download/dev-2025-09/odin-macos-arm64-dev-2025-09.zip"
}