-
Notifications
You must be signed in to change notification settings - Fork 258
Expand file tree
/
Copy pathfunctions_test.sh
More file actions
executable file
·77 lines (60 loc) · 1.86 KB
/
functions_test.sh
File metadata and controls
executable file
·77 lines (60 loc) · 1.86 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
71
72
73
74
75
76
77
#!/usr/bin/env bash
. ./test/helper.sh
. ./share/ruby-install/ruby-install.sh
function setUp()
{
ruby="mruby"
ruby_version="3.0.0"
source "$ruby_install_dir/functions.sh"
source "$ruby_install_dir/mruby/functions.sh"
}
function test_ruby_archive_default_value()
{
assertEquals "did not correctly set \$ruby_archive" \
"mruby-${ruby_version}.tar.gz" \
"$ruby_archive"
}
function test_ruby_archive_when_its_already_set()
{
ruby_archive="ruby-custom-1.2.3.tar.bz2"
source "$ruby_install_dir/functions.sh"
source "$ruby_install_dir/mruby/functions.sh"
assertEquals "did not preserve the \$ruby_archive value" \
"ruby-custom-1.2.3.tar.bz2" \
"$ruby_archive"
}
function test_ruby_mirror_default_value()
{
assertEquals "did not correctly set \$ruby_mirror" \
"https://github.com/mruby/mruby/archive" \
"$ruby_mirror"
}
function test_ruby_mirror_when_its_already_set()
{
ruby_mirror="https://example.com/pub/mruby"
source "$ruby_install_dir/functions.sh"
source "$ruby_install_dir/mruby/functions.sh"
assertEquals "did not preserve the \$ruby_mirror value" \
"https://example.com/pub/mruby" \
"$ruby_mirror"
}
function test_ruby_url_default_value()
{
assertEquals "did not correctly set \$ruby_url" \
"https://github.com/mruby/mruby/archive/$ruby_version/$ruby_archive" \
"$ruby_url"
}
function test_ruby_url_when_its_already_set()
{
ruby_url="https://example.com/pub/mruby/mruby-1.2.3.tar.gz"
source "$ruby_install_dir/functions.sh"
source "$ruby_install_dir/mruby/functions.sh"
assertEquals "did not preserve the \$ruby_url value" \
"https://example.com/pub/mruby/mruby-1.2.3.tar.gz" \
"$ruby_url"
}
function tearDown()
{
unset ruby ruby_version ruby_archive ruby_mirror ruby_url
}
SHUNIT_PARENT=$0 . $SHUNIT2