gloo 6.4.0 → 6.5.1
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 +11 -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 +13 -2
- 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
|
@@ -5,73 +5,71 @@
|
|
|
5
5
|
# file under /tmp, exercise it, and delete it at the end.
|
|
6
6
|
#
|
|
7
7
|
|
|
8
|
-
tests [can] :
|
|
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
|
-
check ^^.f for exists?
|
|
77
|
-
refute "expected the file to be gone after delete"
|
|
8
|
+
tests.objs.file [can] :
|
|
9
|
+
|
|
10
|
+
f [file] : /tmp/gloo_file_test.txt
|
|
11
|
+
names [file] : /Users/me/project/report.csv
|
|
12
|
+
|
|
13
|
+
first [string] : first line
|
|
14
|
+
second [string] : second line
|
|
15
|
+
back [string] :
|
|
16
|
+
|
|
17
|
+
write_read_round_trip [test] :
|
|
18
|
+
description [string] : write puts an object's value in the file; read gets it back.
|
|
19
|
+
on_test [script] :
|
|
20
|
+
tell ^^.f to write ( ^^.first )
|
|
21
|
+
|
|
22
|
+
check ^^.f for exists?
|
|
23
|
+
assert "expected the file to exist after write"
|
|
24
|
+
|
|
25
|
+
check ^^.f for is_file?
|
|
26
|
+
assert "expected exists to be a regular file"
|
|
27
|
+
|
|
28
|
+
check ^^.f for is_dir?
|
|
29
|
+
refute "expected the file not to be a directory"
|
|
30
|
+
|
|
31
|
+
tell ^^.f to read ( ^^.back )
|
|
32
|
+
eval ^^.back = 'first line'
|
|
33
|
+
assert "expected read to return what was written"
|
|
34
|
+
|
|
35
|
+
tell ^^.f to delete
|
|
36
|
+
|
|
37
|
+
append_adds_a_line [test] :
|
|
38
|
+
description [string] : append adds a new line to the file.
|
|
39
|
+
on_test [script] :
|
|
40
|
+
tell ^^.f to write ( ^^.first )
|
|
41
|
+
tell ^^.f to append ( ^^.second )
|
|
42
|
+
|
|
43
|
+
tell ^^.f to read ( ^^.back )
|
|
44
|
+
check ^^.back for substring? ( "first line" )
|
|
45
|
+
assert "expected the original line to still be there"
|
|
46
|
+
check ^^.back for substring? ( "second line" )
|
|
47
|
+
assert "expected the appended line to be there"
|
|
48
|
+
|
|
49
|
+
tell ^^.f to delete
|
|
50
|
+
|
|
51
|
+
path_parts [test] :
|
|
52
|
+
description [string] : get_name, get_ext and get_parent read the path, not the disk.
|
|
53
|
+
on_test [script] :
|
|
54
|
+
tell ^^.names to get_name
|
|
55
|
+
eval it = 'report'
|
|
56
|
+
assert "expected the base name without extension"
|
|
57
|
+
|
|
58
|
+
tell ^^.names to get_ext
|
|
59
|
+
eval it = '.csv'
|
|
60
|
+
assert "expected the extension"
|
|
61
|
+
|
|
62
|
+
tell ^^.names to get_parent
|
|
63
|
+
eval it = '/Users/me/project'
|
|
64
|
+
assert "expected the parent directory"
|
|
65
|
+
|
|
66
|
+
delete_removes_the_file [test] :
|
|
67
|
+
description [string] : delete removes the file from disk.
|
|
68
|
+
on_test [script] :
|
|
69
|
+
tell ^^.f to write ( ^^.first )
|
|
70
|
+
check ^^.f for exists?
|
|
71
|
+
assert "sanity: file exists before delete"
|
|
72
|
+
|
|
73
|
+
tell ^^.f to delete
|
|
74
|
+
check ^^.f for exists?
|
|
75
|
+
refute "expected the file to be gone after delete"
|
|
@@ -7,48 +7,46 @@
|
|
|
7
7
|
# after_invoke event.
|
|
8
8
|
#
|
|
9
9
|
|
|
10
|
-
tests [can] :
|
|
11
|
-
objs [can] :
|
|
12
|
-
function [can] :
|
|
10
|
+
tests.objs.function [can] :
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
after_ran [bool] : false
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
greet [ƒ] :
|
|
15
|
+
params [can] :
|
|
16
|
+
name [string] : Default Person
|
|
17
|
+
on_invoke [script] :
|
|
18
|
+
put 'Hi, ' + ^.params.name into ^.result
|
|
19
|
+
after_invoke [script] :
|
|
20
|
+
put true into tests.objs.function.after_ran
|
|
21
|
+
result [string] :
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
23
|
+
boom [ƒ] :
|
|
24
|
+
params [can] :
|
|
25
|
+
on_invoke [script] :
|
|
26
|
+
put no_such_object into ^.result
|
|
27
|
+
after_invoke [script] :
|
|
28
|
+
put true into tests.objs.function.after_ran
|
|
29
|
+
result [string] :
|
|
32
30
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
invoke_message_uses_param_defaults [test] :
|
|
32
|
+
description [string] : the invoke message with no args runs on_invoke against the param defaults.
|
|
33
|
+
on_test [script] :
|
|
34
|
+
tell ^^.greet to invoke
|
|
35
|
+
eval ^^.greet.result = 'Hi, Default Person'
|
|
36
|
+
assert "expected on_invoke to run with the default param value"
|
|
39
37
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
38
|
+
after_invoke_runs_on_success [test] :
|
|
39
|
+
description [string] : after_invoke runs once the function has been invoked.
|
|
40
|
+
on_test [script] :
|
|
41
|
+
put false into ^^.after_ran
|
|
42
|
+
tell ^^.greet to invoke
|
|
43
|
+
eval ^^.after_ran = true
|
|
44
|
+
assert "expected after_invoke to run after a successful invoke"
|
|
47
45
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
46
|
+
after_invoke_runs_on_failure [test] :
|
|
47
|
+
description [string] : after_invoke still runs when on_invoke hits an error.
|
|
48
|
+
on_test [script] :
|
|
49
|
+
put false into ^^.after_ran
|
|
50
|
+
tell ^^.boom to invoke
|
|
51
|
+
eval ^^.after_ran = true
|
|
52
|
+
assert "expected after_invoke to run even after on_invoke failed"
|
|
@@ -2,69 +2,67 @@
|
|
|
2
2
|
# Integer tests
|
|
3
3
|
#
|
|
4
4
|
|
|
5
|
-
tests [can] :
|
|
6
|
-
objs [can] :
|
|
7
|
-
int [can] :
|
|
5
|
+
tests.objs.int [can] :
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
a [int] :
|
|
8
|
+
b [int] :
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
set_value_with_msg [test] :
|
|
11
|
+
description [string] : Set the value of the integer
|
|
12
|
+
on_test [script] :
|
|
13
|
+
put 1 into ^^.b
|
|
14
|
+
eval ^^.b = 1
|
|
15
|
+
assert "expected it to be 1"
|
|
18
16
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
put 2 into ^^.a
|
|
18
|
+
eval ^^.a = ^^.b
|
|
19
|
+
refute "expected them to not be equal"
|
|
22
20
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
put 1 into ^^.a
|
|
22
|
+
eval ^^.a = ^^.b
|
|
23
|
+
assert "expected them to be equal"
|
|
26
24
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
inc_int [test] :
|
|
26
|
+
description [string] : Increment the integer
|
|
27
|
+
on_test [script] :
|
|
28
|
+
put 1 into ^^.a
|
|
29
|
+
tell ^^.a to inc
|
|
30
|
+
eval ^^.a = 2
|
|
31
|
+
assert "expected it to be 2"
|
|
34
32
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
dec_int [test] :
|
|
34
|
+
description [string] : Decrement the integer
|
|
35
|
+
on_test [script] :
|
|
36
|
+
put 1 into ^^.a
|
|
37
|
+
tell ^^.a to dec
|
|
38
|
+
eval ^^.a = 0
|
|
39
|
+
assert "expected it to be 0"
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
41
|
+
rand_int [test] :
|
|
42
|
+
description [string] : Randomize the integer
|
|
43
|
+
on_test [script] :
|
|
44
|
+
put 1 into ^^.a
|
|
45
|
+
tell ^^.a to randomize
|
|
46
|
+
eval ^^.a >= 0
|
|
47
|
+
assert "expected it to be greater than or equal to 0"
|
|
48
|
+
eval ^^.a <= 100
|
|
49
|
+
assert "expected it to be less than or equal to 100"
|
|
52
50
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
tell ^^.a to randomize (10000)
|
|
52
|
+
tell ^^.b to randomize (10000)
|
|
53
|
+
eval ^^.a = ^^.b
|
|
54
|
+
refute "expected them to not be equal"
|
|
57
55
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
format_int [test] :
|
|
57
|
+
description [string] : Format an integer
|
|
58
|
+
f [int] :
|
|
59
|
+
on_test [script] :
|
|
60
|
+
put 1234567 into ^.f
|
|
61
|
+
tell ^.f to format
|
|
62
|
+
eval it = '1,234,567'
|
|
63
|
+
assert "expected formatted integer to match"
|
|
66
64
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
65
|
+
put 42 into ^.f
|
|
66
|
+
tell ^.f to format ('%05d')
|
|
67
|
+
eval it = '00042'
|
|
68
|
+
assert "expected formatted integer to match"
|
|
@@ -2,78 +2,76 @@
|
|
|
2
2
|
# JSON object tests
|
|
3
3
|
#
|
|
4
4
|
|
|
5
|
-
tests [can] :
|
|
6
|
-
objs [can] :
|
|
7
|
-
json [can] :
|
|
5
|
+
tests.objs.json [can] :
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
payload [json] : BEGIN
|
|
10
8
|
{ "title":"Brute Force",
|
|
11
9
|
"meta":{ "author":"ESR", "year":"2003" } }
|
|
12
10
|
END
|
|
13
11
|
|
|
14
|
-
|
|
12
|
+
compact [json] : {"a":"1","b":{"c":"2"}}
|
|
15
13
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
source [can] :
|
|
15
|
+
name [string] : gloo
|
|
16
|
+
kind [string] : language
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
built [json] :
|
|
19
|
+
out [can] :
|
|
20
|
+
found [string] :
|
|
21
|
+
assigned [json] :
|
|
24
22
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
23
|
+
get_a_value [test] :
|
|
24
|
+
description [string] : get pulls a value out by dotted path.
|
|
25
|
+
on_test [script] :
|
|
26
|
+
tell ^^.payload to get ( 'title' )
|
|
27
|
+
eval it = 'Brute Force'
|
|
28
|
+
assert "expected the top-level title"
|
|
31
29
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
30
|
+
tell ^^.payload to get ( 'meta.author' )
|
|
31
|
+
eval it = 'ESR'
|
|
32
|
+
assert "expected the nested author"
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
get_missing_is_blank [test] :
|
|
35
|
+
description [string] : get for a path that isn't there returns blank.
|
|
36
|
+
on_test [script] :
|
|
37
|
+
tell ^^.payload to get ( 'nope' )
|
|
38
|
+
put it into tests.objs.json.found
|
|
39
|
+
check tests.objs.json.found for blank?
|
|
40
|
+
assert "expected a missing path to return blank"
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
parse_into_objects [test] :
|
|
43
|
+
description [string] : parse builds an object tree from the JSON.
|
|
44
|
+
on_test [script] :
|
|
45
|
+
tell ^^.payload to parse ( tests.objs.json.out )
|
|
48
46
|
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
eval tests.objs.json.out.title = 'Brute Force'
|
|
48
|
+
assert "expected parse to set the title"
|
|
51
49
|
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
eval tests.objs.json.out.meta.author = 'ESR'
|
|
51
|
+
assert "expected parse to build the nested meta container"
|
|
54
52
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
set_from_objects_round_trip [test] :
|
|
54
|
+
description [string] : set serialises an object tree; get reads it back.
|
|
55
|
+
on_test [script] :
|
|
56
|
+
# a path inside ( ) params must be absolute, not a ^ ref
|
|
57
|
+
tell ^^.built to set ( tests.objs.json.source )
|
|
60
58
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
tell ^^.built to get ( 'name' )
|
|
60
|
+
eval it = 'gloo'
|
|
61
|
+
assert "expected set then get to round-trip a value"
|
|
64
62
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
63
|
+
pretty_keeps_it_valid [test] :
|
|
64
|
+
description [string] : pretty reformats the text without breaking it.
|
|
65
|
+
on_test [script] :
|
|
66
|
+
tell ^^.compact to pretty
|
|
67
|
+
tell ^^.compact to get ( 'b.c' )
|
|
68
|
+
eval it = '2'
|
|
69
|
+
assert "expected the value to still be reachable after pretty"
|
|
72
70
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
71
|
+
assign_a_json_string_at_run_time [test] :
|
|
72
|
+
description [string] : a quote-containing literal can be put into an object at run time.
|
|
73
|
+
on_test [script] :
|
|
74
|
+
put '{"lang":"gloo","ok":true}' into tests.objs.json.assigned
|
|
75
|
+
tell ^^.assigned to get ( 'lang' )
|
|
76
|
+
eval it = 'gloo'
|
|
77
|
+
assert "expected the run-time JSON string to be assigned and readable"
|
|
@@ -2,51 +2,71 @@
|
|
|
2
2
|
# Root 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
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
5
|
+
tests.objs.obj [can] :
|
|
6
|
+
|
|
7
|
+
o [any] :
|
|
8
|
+
a [can] :
|
|
9
|
+
b [string] : "b"
|
|
10
|
+
c [string] : "c"
|
|
11
|
+
d [string] : "d"
|
|
12
|
+
|
|
13
|
+
# A documented string, used to check the doc message.
|
|
14
|
+
documented [string] : "value"
|
|
15
|
+
|
|
16
|
+
no_doc [string] : "value"
|
|
17
|
+
|
|
18
|
+
obj_contains [test] :
|
|
19
|
+
description [string] : Check to see if an object contains children
|
|
20
|
+
on_test [script] :
|
|
21
|
+
check tests.objs.obj.o for contains?
|
|
22
|
+
refute "the object does not contain children"
|
|
23
|
+
|
|
24
|
+
check tests.objs.obj.a for contains?
|
|
25
|
+
assert "the object contains children"
|
|
26
|
+
|
|
27
|
+
blank_object [test] :
|
|
28
|
+
description [string] : Check for a blank string
|
|
29
|
+
on_test [script] :
|
|
30
|
+
check tests.objs.obj.a.b for blank?
|
|
31
|
+
refute "the string should be blank"
|
|
32
|
+
|
|
33
|
+
check tests.objs.obj.o for blank?
|
|
34
|
+
assert "the object should be blank"
|
|
35
|
+
|
|
36
|
+
responds_to_blank [test] :
|
|
37
|
+
description [string] : Verify that all objects respond to blank? msessage
|
|
38
|
+
on_test [script] :
|
|
39
|
+
check tests.objs.obj.o for responds_to? ('blank?')
|
|
40
|
+
assert "expected any object to respond to blank?"
|
|
41
|
+
|
|
42
|
+
responds_to_contains [test] :
|
|
43
|
+
description [string] : Verify that all objects respond to contains? msessage
|
|
44
|
+
on_test [script] :
|
|
45
|
+
check tests.objs.obj.o for responds_to? ('contains?')
|
|
46
|
+
assert "expected any object to respond to contains?"
|
|
47
|
+
|
|
48
|
+
responds_to_up [test] :
|
|
49
|
+
description [string] : Verify that strings respond to up msessage
|
|
50
|
+
on_test [script] :
|
|
51
|
+
check tests.objs.obj.o for responds_to? ('up')
|
|
52
|
+
refute "expected any object to not respond to up"
|
|
53
|
+
|
|
54
|
+
check tests.objs.obj.a.b for responds_to? ('up')
|
|
55
|
+
assert "expected string to respond to up"
|
|
56
|
+
|
|
57
|
+
responds_to_doc [test] :
|
|
58
|
+
description [string] : Verify that all objects respond to doc message
|
|
59
|
+
on_test [script] :
|
|
60
|
+
check tests.objs.obj.o for responds_to? ('doc')
|
|
61
|
+
assert "expected any object to respond to doc"
|
|
62
|
+
|
|
63
|
+
doc_message [test] :
|
|
64
|
+
description [string] : doc returns the object's leading comment, cleaned up.
|
|
65
|
+
on_test [script] :
|
|
66
|
+
check tests.objs.obj.documented for doc
|
|
67
|
+
eval it = "A documented string, used to check the doc message."
|
|
68
|
+
assert "expected doc to return the cleaned leading comment"
|
|
69
|
+
|
|
70
|
+
check tests.objs.obj.no_doc for doc
|
|
71
|
+
eval it = ""
|
|
72
|
+
assert "expected doc to be blank for an object with no leading comment"
|