gloo 6.4.0 → 6.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/docs/application.md +9 -0
- data/docs/language_objects.md +40 -0
- data/docs/objects.md +1 -1
- data/docs/verbs.md +9 -0
- data/lib/VERSION +1 -1
- data/lib/VERSION_NOTES +7 -0
- data/lib/gloo/app/engine.rb +5 -1
- data/lib/gloo/app/log.rb +5 -5
- data/lib/gloo/app/settings.rb +4 -1
- data/lib/gloo/core/obj.rb +21 -1
- data/lib/gloo/persist/file_loader.rb +7 -0
- data/lib/gloo/persist/persist_man.rb +35 -3
- data/lib/gloo/persist/source/obj_node.rb +41 -0
- data/lib/gloo/verbs/list.rb +24 -2
- data/lib/gloo/verbs/load.rb +4 -1
- data/test.gloo/ctrl/each.test.gloo +28 -30
- data/test.gloo/dt/date.test.gloo +69 -71
- data/test.gloo/dt/datetime.test.gloo +55 -57
- data/test.gloo/dt/time.test.gloo +70 -72
- data/test.gloo/lang/continuation.test.gloo +25 -27
- data/test.gloo/lang/convert.test.gloo +50 -52
- data/test.gloo/lang/dt_comparisons.test.gloo +87 -89
- data/test.gloo/lang/exceptions.test.gloo +42 -44
- data/test.gloo/lang/gloo_sys.test.gloo +100 -102
- data/test.gloo/lang/here.test.gloo +32 -34
- data/test.gloo/lang/it.test.gloo +27 -29
- data/test.gloo/lang/literal.test.gloo +55 -57
- data/test.gloo/lang/load_lib_directive.test.gloo +18 -20
- data/test.gloo/lang/naming.test.gloo +28 -30
- data/test.gloo/lang/ops.test.gloo +53 -55
- data/test.gloo/lang/shorthand.test.gloo +15 -17
- data/test.gloo/math/add.test.gloo +40 -42
- data/test.gloo/math/div.test.gloo +23 -25
- data/test.gloo/math/mult.test.gloo +23 -25
- data/test.gloo/math/sub.test.gloo +23 -25
- data/test.gloo/objs/alias.test.gloo +15 -17
- data/test.gloo/objs/bool.test.gloo +54 -56
- data/test.gloo/objs/can.test.gloo +33 -35
- data/test.gloo/objs/cipher.test.gloo +39 -41
- data/test.gloo/objs/decimal.test.gloo +27 -29
- data/test.gloo/objs/erb.test.gloo +47 -49
- data/test.gloo/objs/file.test.gloo +68 -70
- data/test.gloo/objs/function.test.gloo +37 -39
- data/test.gloo/objs/int.test.gloo +54 -56
- data/test.gloo/objs/json.test.gloo +56 -58
- data/test.gloo/objs/obj.test.gloo +68 -48
- data/test.gloo/objs/outline.test.gloo +48 -50
- data/test.gloo/objs/password.test.gloo +34 -36
- data/test.gloo/objs/repeat.test.gloo +42 -44
- data/test.gloo/objs/script.test.gloo +13 -15
- data/test.gloo/objs/string.test.gloo +82 -84
- data/test.gloo/objs/text.test.gloo +90 -92
- data/test.gloo/objs/untyped.test.gloo +36 -38
- data/test.gloo/objs/uri.test.gloo +37 -39
- data/test.gloo/verbs/break.test.gloo +12 -14
- data/test.gloo/verbs/check.test.gloo +22 -24
- data/test.gloo/verbs/context.test.gloo +11 -13
- data/test.gloo/verbs/create.test.gloo +7 -9
- data/test.gloo/verbs/eval.test.gloo +10 -12
- data/test.gloo/verbs/exists.test.gloo +43 -45
- data/test.gloo/verbs/if.test.gloo +8 -10
- data/test.gloo/verbs/invoke.test.gloo +73 -75
- data/test.gloo/verbs/list.test.gloo +21 -23
- data/test.gloo/verbs/load.test.gloo +27 -21
- data/test.gloo/verbs/log.test.gloo +7 -9
- data/test.gloo/verbs/move.test.gloo +12 -14
- data/test.gloo/verbs/put.test.gloo +10 -12
- data/test.gloo/verbs/reload.test.gloo +30 -32
- data/test.gloo/verbs/run.test.gloo +8 -10
- data/test.gloo/verbs/save.test.gloo +90 -94
- data/test.gloo/verbs/show.test.gloo +26 -28
- data/test.gloo/verbs/tell.test.gloo +8 -10
- data/test.gloo/verbs/throw.test.gloo +31 -33
- data/test.gloo/verbs/unless.test.gloo +13 -15
- data/test.gloo/verbs/unload.test.gloo +10 -12
- metadata +1 -1
|
@@ -2,36 +2,34 @@
|
|
|
2
2
|
# Multiplication tests
|
|
3
3
|
#
|
|
4
4
|
|
|
5
|
-
tests [can] :
|
|
6
|
-
math [can] :
|
|
7
|
-
mult [can] :
|
|
5
|
+
tests.math.mult [can] :
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
mult_ints [test] :
|
|
8
|
+
description [string] : Multiply two integers
|
|
9
|
+
on_test [script] :
|
|
10
|
+
eval 2 * 3 = 6
|
|
11
|
+
assert 'expected 2 * 3 = 6'
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
eval 10 * 20 = 200
|
|
14
|
+
assert 'expected 10 * 20 = 200'
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
eval 100 * 200 = 20000
|
|
17
|
+
assert 'expected 100 * 200 = 20000'
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
eval 1 * 3 = 1
|
|
20
|
+
refute 'expected 1 * 3 != 1'
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
mult_decimals [test] :
|
|
23
|
+
description [string] : Multiply two decimals
|
|
24
|
+
on_test [script] :
|
|
25
|
+
eval 1.5 * 5.5 = 8.25
|
|
26
|
+
assert 'expected 1.5 * 5.5 = 8.25'
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
eval 10.5 * 20.5 = 214.5
|
|
29
|
+
assert 'expected 10.5 * 20.5 = 214.5'
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
eval 100.5 * 200.5 = 20100.25
|
|
32
|
+
assert 'expected 100.5 * 200.5 = 20100.25'
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
eval 1.5 * 10.5 = 10
|
|
35
|
+
refute 'expected 1.5 * 10.5 != 10'
|
|
@@ -2,36 +2,34 @@
|
|
|
2
2
|
# Subtraction tests
|
|
3
3
|
#
|
|
4
4
|
|
|
5
|
-
tests [can] :
|
|
6
|
-
math [can] :
|
|
7
|
-
sub [can] :
|
|
5
|
+
tests.math.sub [can] :
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
sub_ints [test] :
|
|
8
|
+
description [string] : Subtract two integers
|
|
9
|
+
on_test [script] :
|
|
10
|
+
eval 2 - 3 = -1
|
|
11
|
+
assert 'expected 2 - 3 = -1'
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
eval 10 - 20 = -10
|
|
14
|
+
assert 'expected 10 - 20 = -10'
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
eval 100 - 200 = -100
|
|
17
|
+
assert 'expected 100 - 200 = -100'
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
eval 1 - 3 = -1
|
|
20
|
+
refute 'expected 1 - 3 != -1'
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
22
|
+
sub_decimals [test] :
|
|
23
|
+
description [string] : Subtract two decimals
|
|
24
|
+
on_test [script] :
|
|
25
|
+
eval 1.5 - 5.5 = -4
|
|
26
|
+
assert 'expected 1.5 - 5.5 = -4'
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
eval 10.5 - 20.5 = -10
|
|
29
|
+
assert 'expected 10.5 - 20.5 = -10'
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
eval 100.5 - 200.5 = -100
|
|
32
|
+
assert 'expected 100.5 - 200.5 = -100'
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
eval 1.5 - 10.5 = -1
|
|
35
|
+
refute 'expected 1.5 - 10.5 != -1'
|
|
@@ -2,23 +2,21 @@
|
|
|
2
2
|
# Alias tests
|
|
3
3
|
#
|
|
4
4
|
|
|
5
|
-
tests [can] :
|
|
6
|
-
objs [can] :
|
|
7
|
-
alias [can] :
|
|
5
|
+
tests.objs.alias [can] :
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
s [string] : hello
|
|
8
|
+
ln [alias] : tests.objs.alias.s
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
follow_alias [test] :
|
|
11
|
+
description [string] : Follow an alias to the target value
|
|
12
|
+
on_test [script] :
|
|
13
|
+
put 'hello' into ^^.s
|
|
14
|
+
eval ^^.ln = 'hello'
|
|
15
|
+
assert "expected alias to resolve to 'hello'"
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
put_via_alias [test] :
|
|
18
|
+
description [string] : Put a value via an alias
|
|
19
|
+
on_test [script] :
|
|
20
|
+
put 'world' into ^^.ln
|
|
21
|
+
eval ^^.s = 'world'
|
|
22
|
+
assert "expected s to be updated via alias"
|
|
@@ -2,59 +2,57 @@
|
|
|
2
2
|
# Boolean tests
|
|
3
3
|
#
|
|
4
4
|
|
|
5
|
-
tests [can] :
|
|
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
|
-
eval ^^.b = false
|
|
60
|
-
assert "expected b to be false"
|
|
5
|
+
tests.objs.bool [can] :
|
|
6
|
+
|
|
7
|
+
a [boolean] :
|
|
8
|
+
b [boolean] :
|
|
9
|
+
|
|
10
|
+
set_value_with_msg [test] :
|
|
11
|
+
description [string] : Set the value of the boolean
|
|
12
|
+
on_test [script] :
|
|
13
|
+
tell ^^.b to true
|
|
14
|
+
assert "expected it to be true"
|
|
15
|
+
|
|
16
|
+
eval ^^.b
|
|
17
|
+
assert "expected b to be true"
|
|
18
|
+
|
|
19
|
+
tell ^^.b to false
|
|
20
|
+
refute "expected it to be false"
|
|
21
|
+
|
|
22
|
+
eval ^^.b
|
|
23
|
+
refute "expected b to be false"
|
|
24
|
+
|
|
25
|
+
not_value [test] :
|
|
26
|
+
description [string] : Set the value of the boolean and not it
|
|
27
|
+
on_test [script] :
|
|
28
|
+
tell ^^.b to true
|
|
29
|
+
tell ^^.b to not
|
|
30
|
+
refute "expected it to be false"
|
|
31
|
+
|
|
32
|
+
tell ^^.b to false
|
|
33
|
+
tell ^^.b to not
|
|
34
|
+
assert "expected it to be true"
|
|
35
|
+
|
|
36
|
+
compare_values [test] :
|
|
37
|
+
description [string] : Compare the value of two booleans
|
|
38
|
+
on_test [script] :
|
|
39
|
+
tell ^^.a to true
|
|
40
|
+
put true into ^^.b
|
|
41
|
+
eval ^^.b = ^^.a
|
|
42
|
+
assert "expected both to be true"
|
|
43
|
+
|
|
44
|
+
tell ^^.a to false
|
|
45
|
+
put false into ^^.b
|
|
46
|
+
eval ^^.b = ^^.a
|
|
47
|
+
assert "expected both to be false"
|
|
48
|
+
|
|
49
|
+
set_value [test] :
|
|
50
|
+
description [string] : Set the value of the boolean
|
|
51
|
+
on_test [script] :
|
|
52
|
+
put true into ^^.b
|
|
53
|
+
eval ^^.b = true
|
|
54
|
+
assert "expected b to be true"
|
|
55
|
+
|
|
56
|
+
put false into ^^.b
|
|
57
|
+
eval ^^.b = false
|
|
58
|
+
assert "expected b to be false"
|
|
@@ -2,46 +2,44 @@
|
|
|
2
2
|
# Container tests
|
|
3
3
|
#
|
|
4
4
|
|
|
5
|
-
tests [can] :
|
|
6
|
-
objs [can] :
|
|
7
|
-
can [can] :
|
|
5
|
+
tests.objs.can [can] :
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
a [can] :
|
|
8
|
+
b [string] : "b"
|
|
9
|
+
c [string] : "c"
|
|
10
|
+
d [string] : "d"
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
count_children [test] :
|
|
13
|
+
description [string] : Verify the number of children
|
|
14
|
+
on_test [script] :
|
|
15
|
+
tell tests.objs.can.a to count
|
|
16
|
+
eval it = 3
|
|
17
|
+
assert "expected it to be 3"
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
test_contains [test] :
|
|
20
|
+
description [string] : Verify the container contains
|
|
21
|
+
on_test [script] :
|
|
22
|
+
check tests.objs.can.a for contains?
|
|
23
|
+
assert "expected can to contains"
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
check tests.objs.can.a.b for contains?
|
|
26
|
+
refute "expected string to not contains"
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
create_container [test] :
|
|
29
|
+
description [string] : Create a container and verify
|
|
30
|
+
on_test [script] :
|
|
31
|
+
create tests.objs.can.c as container
|
|
32
|
+
tell tests.objs.can.c to count
|
|
33
|
+
eval it = 0
|
|
34
|
+
assert "expected it to be 0"
|
|
37
35
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
create tests.objs.can.c.s as string
|
|
37
|
+
tell tests.objs.can.c to count
|
|
38
|
+
eval it = 1
|
|
39
|
+
assert "expected it to be 1"
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
tell tests.objs.can.c to delete_children
|
|
42
|
+
tell tests.objs.can.c to count
|
|
43
|
+
eval it = 0
|
|
44
|
+
assert "expected it to be 0"
|
|
47
45
|
|
|
@@ -2,44 +2,42 @@
|
|
|
2
2
|
# Cipher object tests
|
|
3
3
|
#
|
|
4
4
|
|
|
5
|
-
tests [can] :
|
|
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
|
-
eval tests.objs.cipher.b.data = ^^.plaintext
|
|
45
|
-
assert "expected the second cipher to decrypt with the shared key"
|
|
5
|
+
tests.objs.cipher [can] :
|
|
6
|
+
|
|
7
|
+
plaintext [string] : attack at dawn
|
|
8
|
+
|
|
9
|
+
round_trip [test] :
|
|
10
|
+
description [string] : encrypt then decrypt returns the original text.
|
|
11
|
+
on_test [script] :
|
|
12
|
+
create tests.objs.cipher.c as cipher
|
|
13
|
+
|
|
14
|
+
tell tests.objs.cipher.c to generate_keys
|
|
15
|
+
check tests.objs.cipher.c.key for blank?
|
|
16
|
+
refute "expected generate_keys to set a key"
|
|
17
|
+
|
|
18
|
+
put ^^.plaintext into tests.objs.cipher.c.data
|
|
19
|
+
tell tests.objs.cipher.c to encrypt
|
|
20
|
+
eval tests.objs.cipher.c.data = ^^.plaintext
|
|
21
|
+
refute "expected the data to be encrypted (not the plaintext)"
|
|
22
|
+
|
|
23
|
+
tell tests.objs.cipher.c to decrypt
|
|
24
|
+
eval tests.objs.cipher.c.data = ^^.plaintext
|
|
25
|
+
assert "expected decrypt to restore the original text"
|
|
26
|
+
|
|
27
|
+
shared_keys [test] :
|
|
28
|
+
description [string] : a second cipher with the same key + init_vector can decrypt.
|
|
29
|
+
on_test [script] :
|
|
30
|
+
create tests.objs.cipher.a as cipher
|
|
31
|
+
create tests.objs.cipher.b as cipher
|
|
32
|
+
|
|
33
|
+
tell tests.objs.cipher.a to generate_keys
|
|
34
|
+
put ^^.plaintext into tests.objs.cipher.a.data
|
|
35
|
+
tell tests.objs.cipher.a to encrypt
|
|
36
|
+
|
|
37
|
+
put tests.objs.cipher.a.key into tests.objs.cipher.b.key
|
|
38
|
+
put tests.objs.cipher.a.init_vector into tests.objs.cipher.b.init_vector
|
|
39
|
+
put tests.objs.cipher.a.data into tests.objs.cipher.b.data
|
|
40
|
+
|
|
41
|
+
tell tests.objs.cipher.b to decrypt
|
|
42
|
+
eval tests.objs.cipher.b.data = ^^.plaintext
|
|
43
|
+
assert "expected the second cipher to decrypt with the shared key"
|
|
@@ -2,37 +2,35 @@
|
|
|
2
2
|
# Decimal tests
|
|
3
3
|
#
|
|
4
4
|
|
|
5
|
-
tests [can] :
|
|
6
|
-
objs [can] :
|
|
7
|
-
decimal [can] :
|
|
5
|
+
tests.objs.decimal [can] :
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
a [decimal] :
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
set_value [test] :
|
|
10
|
+
description [string] : Set a decimal value
|
|
11
|
+
on_test [script] :
|
|
12
|
+
put 3.14 into ^^.a
|
|
13
|
+
eval ^^.a = 3.14
|
|
14
|
+
assert "expected a to be 3.14"
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
round_decimal [test] :
|
|
17
|
+
description [string] : Round a decimal value
|
|
18
|
+
on_test [script] :
|
|
19
|
+
put 3.7 into ^^.a
|
|
20
|
+
tell ^^.a to round
|
|
21
|
+
eval ^^.a = 4.0
|
|
22
|
+
assert "expected a to be rounded to 4.0"
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
format_decimal [test] :
|
|
25
|
+
description [string] : Format a decimal
|
|
26
|
+
f [decimal] :
|
|
27
|
+
on_test [script] :
|
|
28
|
+
put 1234567.891 into ^.f
|
|
29
|
+
tell ^.f to format
|
|
30
|
+
eval it = '1,234,567.891'
|
|
31
|
+
assert "expected formatted decimal to match"
|
|
34
32
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
put 3.14159 into ^.f
|
|
34
|
+
tell ^.f to format ('%.2f')
|
|
35
|
+
eval it = '3.14'
|
|
36
|
+
assert "expected formatted decimal to match"
|
|
@@ -2,52 +2,50 @@
|
|
|
2
2
|
# ERB tests
|
|
3
3
|
#
|
|
4
4
|
|
|
5
|
-
tests [can] :
|
|
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
|
-
eval ^^.with_logic.result = 'ACTIVE'
|
|
53
|
-
assert "expected the 'yes' param to render the ACTIVE branch"
|
|
5
|
+
tests.objs.erb [can] :
|
|
6
|
+
|
|
7
|
+
greeting [string] : <%= name %>!!
|
|
8
|
+
|
|
9
|
+
basic [erb] :
|
|
10
|
+
template [text] : <%= name %>
|
|
11
|
+
params [can] :
|
|
12
|
+
name [string] : world
|
|
13
|
+
result [text] :
|
|
14
|
+
|
|
15
|
+
aliased_template [erb] :
|
|
16
|
+
template [alias] : tests.objs.erb.greeting
|
|
17
|
+
params [can] :
|
|
18
|
+
name [string] : gloo
|
|
19
|
+
result [text] :
|
|
20
|
+
|
|
21
|
+
with_logic [erb] :
|
|
22
|
+
template [text] : <%= n == "yes" ? "ACTIVE" : "closed" %>
|
|
23
|
+
params [can] :
|
|
24
|
+
n [string] : no
|
|
25
|
+
result [text] :
|
|
26
|
+
|
|
27
|
+
run_basic [test] :
|
|
28
|
+
description [string] : Render a template with a param
|
|
29
|
+
on_test [script] :
|
|
30
|
+
tell ^^.basic to run
|
|
31
|
+
eval ^^.basic.result = 'world'
|
|
32
|
+
assert "expected template to render with the param value"
|
|
33
|
+
|
|
34
|
+
run_with_aliased_template [test] :
|
|
35
|
+
description [string] : Render a template whose 'template' child is an alias to another object
|
|
36
|
+
on_test [script] :
|
|
37
|
+
tell ^^.aliased_template to run
|
|
38
|
+
eval ^^.aliased_template.result = 'gloo!!'
|
|
39
|
+
assert "expected alias to be resolved before rendering the template"
|
|
40
|
+
|
|
41
|
+
run_with_logic [test] :
|
|
42
|
+
description [string] : A <% %> tag runs Ruby; the param drives which branch renders
|
|
43
|
+
on_test [script] :
|
|
44
|
+
tell ^^.with_logic to run
|
|
45
|
+
eval ^^.with_logic.result = 'closed'
|
|
46
|
+
assert "expected the 'no' param to render the closed branch"
|
|
47
|
+
|
|
48
|
+
put 'yes' into ^^.with_logic.params.n
|
|
49
|
+
tell ^^.with_logic to run
|
|
50
|
+
eval ^^.with_logic.result = 'ACTIVE'
|
|
51
|
+
assert "expected the 'yes' param to render the ACTIVE branch"
|