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.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/docs/application.md +9 -0
  3. data/docs/language_objects.md +40 -0
  4. data/docs/objects.md +1 -1
  5. data/docs/verbs.md +9 -0
  6. data/lib/VERSION +1 -1
  7. data/lib/VERSION_NOTES +11 -0
  8. data/lib/gloo/app/engine.rb +5 -1
  9. data/lib/gloo/app/log.rb +5 -5
  10. data/lib/gloo/app/settings.rb +4 -1
  11. data/lib/gloo/core/obj.rb +21 -1
  12. data/lib/gloo/persist/file_loader.rb +7 -0
  13. data/lib/gloo/persist/persist_man.rb +35 -3
  14. data/lib/gloo/persist/source/obj_node.rb +41 -0
  15. data/lib/gloo/verbs/list.rb +24 -2
  16. data/lib/gloo/verbs/load.rb +13 -2
  17. data/test.gloo/ctrl/each.test.gloo +28 -30
  18. data/test.gloo/dt/date.test.gloo +69 -71
  19. data/test.gloo/dt/datetime.test.gloo +55 -57
  20. data/test.gloo/dt/time.test.gloo +70 -72
  21. data/test.gloo/lang/continuation.test.gloo +25 -27
  22. data/test.gloo/lang/convert.test.gloo +50 -52
  23. data/test.gloo/lang/dt_comparisons.test.gloo +87 -89
  24. data/test.gloo/lang/exceptions.test.gloo +42 -44
  25. data/test.gloo/lang/gloo_sys.test.gloo +100 -102
  26. data/test.gloo/lang/here.test.gloo +32 -34
  27. data/test.gloo/lang/it.test.gloo +27 -29
  28. data/test.gloo/lang/literal.test.gloo +55 -57
  29. data/test.gloo/lang/load_lib_directive.test.gloo +18 -20
  30. data/test.gloo/lang/naming.test.gloo +28 -30
  31. data/test.gloo/lang/ops.test.gloo +53 -55
  32. data/test.gloo/lang/shorthand.test.gloo +15 -17
  33. data/test.gloo/math/add.test.gloo +40 -42
  34. data/test.gloo/math/div.test.gloo +23 -25
  35. data/test.gloo/math/mult.test.gloo +23 -25
  36. data/test.gloo/math/sub.test.gloo +23 -25
  37. data/test.gloo/objs/alias.test.gloo +15 -17
  38. data/test.gloo/objs/bool.test.gloo +54 -56
  39. data/test.gloo/objs/can.test.gloo +33 -35
  40. data/test.gloo/objs/cipher.test.gloo +39 -41
  41. data/test.gloo/objs/decimal.test.gloo +27 -29
  42. data/test.gloo/objs/erb.test.gloo +47 -49
  43. data/test.gloo/objs/file.test.gloo +68 -70
  44. data/test.gloo/objs/function.test.gloo +37 -39
  45. data/test.gloo/objs/int.test.gloo +54 -56
  46. data/test.gloo/objs/json.test.gloo +56 -58
  47. data/test.gloo/objs/obj.test.gloo +68 -48
  48. data/test.gloo/objs/outline.test.gloo +48 -50
  49. data/test.gloo/objs/password.test.gloo +34 -36
  50. data/test.gloo/objs/repeat.test.gloo +42 -44
  51. data/test.gloo/objs/script.test.gloo +13 -15
  52. data/test.gloo/objs/string.test.gloo +82 -84
  53. data/test.gloo/objs/text.test.gloo +90 -92
  54. data/test.gloo/objs/untyped.test.gloo +36 -38
  55. data/test.gloo/objs/uri.test.gloo +37 -39
  56. data/test.gloo/verbs/break.test.gloo +12 -14
  57. data/test.gloo/verbs/check.test.gloo +22 -24
  58. data/test.gloo/verbs/context.test.gloo +11 -13
  59. data/test.gloo/verbs/create.test.gloo +7 -9
  60. data/test.gloo/verbs/eval.test.gloo +10 -12
  61. data/test.gloo/verbs/exists.test.gloo +43 -45
  62. data/test.gloo/verbs/if.test.gloo +8 -10
  63. data/test.gloo/verbs/invoke.test.gloo +73 -75
  64. data/test.gloo/verbs/list.test.gloo +21 -23
  65. data/test.gloo/verbs/load.test.gloo +27 -21
  66. data/test.gloo/verbs/log.test.gloo +7 -9
  67. data/test.gloo/verbs/move.test.gloo +12 -14
  68. data/test.gloo/verbs/put.test.gloo +10 -12
  69. data/test.gloo/verbs/reload.test.gloo +30 -32
  70. data/test.gloo/verbs/run.test.gloo +8 -10
  71. data/test.gloo/verbs/save.test.gloo +90 -94
  72. data/test.gloo/verbs/show.test.gloo +26 -28
  73. data/test.gloo/verbs/tell.test.gloo +8 -10
  74. data/test.gloo/verbs/throw.test.gloo +31 -33
  75. data/test.gloo/verbs/unless.test.gloo +13 -15
  76. data/test.gloo/verbs/unload.test.gloo +10 -12
  77. 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
- objs [can] :
10
- file [can] :
11
-
12
- f [file] : /tmp/gloo_file_test.txt
13
- names [file] : /Users/me/project/report.csv
14
-
15
- first [string] : first line
16
- second [string] : second line
17
- back [string] :
18
-
19
- write_read_round_trip [test] :
20
- description [string] : write puts an object's value in the file; read gets it back.
21
- on_test [script] :
22
- tell ^^.f to write ( ^^.first )
23
-
24
- check ^^.f for exists?
25
- assert "expected the file to exist after write"
26
-
27
- check ^^.f for is_file?
28
- assert "expected exists to be a regular file"
29
-
30
- check ^^.f for is_dir?
31
- refute "expected the file not to be a directory"
32
-
33
- tell ^^.f to read ( ^^.back )
34
- eval ^^.back = 'first line'
35
- assert "expected read to return what was written"
36
-
37
- tell ^^.f to delete
38
-
39
- append_adds_a_line [test] :
40
- description [string] : append adds a new line to the file.
41
- on_test [script] :
42
- tell ^^.f to write ( ^^.first )
43
- tell ^^.f to append ( ^^.second )
44
-
45
- tell ^^.f to read ( ^^.back )
46
- check ^^.back for substring? ( "first line" )
47
- assert "expected the original line to still be there"
48
- check ^^.back for substring? ( "second line" )
49
- assert "expected the appended line to be there"
50
-
51
- tell ^^.f to delete
52
-
53
- path_parts [test] :
54
- description [string] : get_name, get_ext and get_parent read the path, not the disk.
55
- on_test [script] :
56
- tell ^^.names to get_name
57
- eval it = 'report'
58
- assert "expected the base name without extension"
59
-
60
- tell ^^.names to get_ext
61
- eval it = '.csv'
62
- assert "expected the extension"
63
-
64
- tell ^^.names to get_parent
65
- eval it = '/Users/me/project'
66
- assert "expected the parent directory"
67
-
68
- delete_removes_the_file [test] :
69
- description [string] : delete removes the file from disk.
70
- on_test [script] :
71
- tell ^^.f to write ( ^^.first )
72
- check ^^.f for exists?
73
- assert "sanity: file exists before delete"
74
-
75
- tell ^^.f to delete
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
- after_ran [bool] : false
12
+ after_ran [bool] : false
15
13
 
16
- greet [ƒ] :
17
- params [can] :
18
- name [string] : Default Person
19
- on_invoke [script] :
20
- put 'Hi, ' + ^.params.name into ^.result
21
- after_invoke [script] :
22
- put true into tests.objs.function.after_ran
23
- result [string] :
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
- boom [ƒ] :
26
- params [can] :
27
- on_invoke [script] :
28
- put no_such_object into ^.result
29
- after_invoke [script] :
30
- put true into tests.objs.function.after_ran
31
- result [string] :
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
- invoke_message_uses_param_defaults [test] :
34
- description [string] : the invoke message with no args runs on_invoke against the param defaults.
35
- on_test [script] :
36
- tell ^^.greet to invoke
37
- eval ^^.greet.result = 'Hi, Default Person'
38
- assert "expected on_invoke to run with the default param value"
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
- after_invoke_runs_on_success [test] :
41
- description [string] : after_invoke runs once the function has been invoked.
42
- on_test [script] :
43
- put false into ^^.after_ran
44
- tell ^^.greet to invoke
45
- eval ^^.after_ran = true
46
- assert "expected after_invoke to run after a successful invoke"
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
- after_invoke_runs_on_failure [test] :
49
- description [string] : after_invoke still runs when on_invoke hits an error.
50
- on_test [script] :
51
- put false into ^^.after_ran
52
- tell ^^.boom to invoke
53
- eval ^^.after_ran = true
54
- assert "expected after_invoke to run even after on_invoke failed"
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
- a [int] :
10
- b [int] :
7
+ a [int] :
8
+ b [int] :
11
9
 
12
- set_value_with_msg [test] :
13
- description [string] : Set the value of the integer
14
- on_test [script] :
15
- put 1 into ^^.b
16
- eval ^^.b = 1
17
- assert "expected it to be 1"
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
- put 2 into ^^.a
20
- eval ^^.a = ^^.b
21
- refute "expected them to not be equal"
17
+ put 2 into ^^.a
18
+ eval ^^.a = ^^.b
19
+ refute "expected them to not be equal"
22
20
 
23
- put 1 into ^^.a
24
- eval ^^.a = ^^.b
25
- assert "expected them to be equal"
21
+ put 1 into ^^.a
22
+ eval ^^.a = ^^.b
23
+ assert "expected them to be equal"
26
24
 
27
- inc_int [test] :
28
- description [string] : Increment the integer
29
- on_test [script] :
30
- put 1 into ^^.a
31
- tell ^^.a to inc
32
- eval ^^.a = 2
33
- assert "expected it to be 2"
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
- dec_int [test] :
36
- description [string] : Decrement the integer
37
- on_test [script] :
38
- put 1 into ^^.a
39
- tell ^^.a to dec
40
- eval ^^.a = 0
41
- assert "expected it to be 0"
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
- rand_int [test] :
44
- description [string] : Randomize the integer
45
- on_test [script] :
46
- put 1 into ^^.a
47
- tell ^^.a to randomize
48
- eval ^^.a >= 0
49
- assert "expected it to be greater than or equal to 0"
50
- eval ^^.a <= 100
51
- assert "expected it to be less than or equal to 100"
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
- tell ^^.a to randomize (10000)
54
- tell ^^.b to randomize (10000)
55
- eval ^^.a = ^^.b
56
- refute "expected them to not be equal"
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
- format_int [test] :
59
- description [string] : Format an integer
60
- f [int] :
61
- on_test [script] :
62
- put 1234567 into ^.f
63
- tell ^.f to format
64
- eval it = '1,234,567'
65
- assert "expected formatted integer to match"
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
- put 42 into ^.f
68
- tell ^.f to format ('%05d')
69
- eval it = '00042'
70
- assert "expected formatted integer to match"
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
- payload [json] : BEGIN
7
+ payload [json] : BEGIN
10
8
  { "title":"Brute Force",
11
9
  "meta":{ "author":"ESR", "year":"2003" } }
12
10
  END
13
11
 
14
- compact [json] : {"a":"1","b":{"c":"2"}}
12
+ compact [json] : {"a":"1","b":{"c":"2"}}
15
13
 
16
- source [can] :
17
- name [string] : gloo
18
- kind [string] : language
14
+ source [can] :
15
+ name [string] : gloo
16
+ kind [string] : language
19
17
 
20
- built [json] :
21
- out [can] :
22
- found [string] :
23
- assigned [json] :
18
+ built [json] :
19
+ out [can] :
20
+ found [string] :
21
+ assigned [json] :
24
22
 
25
- get_a_value [test] :
26
- description [string] : get pulls a value out by dotted path.
27
- on_test [script] :
28
- tell ^^.payload to get ( 'title' )
29
- eval it = 'Brute Force'
30
- assert "expected the top-level title"
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
- tell ^^.payload to get ( 'meta.author' )
33
- eval it = 'ESR'
34
- assert "expected the nested author"
30
+ tell ^^.payload to get ( 'meta.author' )
31
+ eval it = 'ESR'
32
+ assert "expected the nested author"
35
33
 
36
- get_missing_is_blank [test] :
37
- description [string] : get for a path that isn't there returns blank.
38
- on_test [script] :
39
- tell ^^.payload to get ( 'nope' )
40
- put it into tests.objs.json.found
41
- check tests.objs.json.found for blank?
42
- assert "expected a missing path to return blank"
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
- parse_into_objects [test] :
45
- description [string] : parse builds an object tree from the JSON.
46
- on_test [script] :
47
- tell ^^.payload to parse ( tests.objs.json.out )
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
- eval tests.objs.json.out.title = 'Brute Force'
50
- assert "expected parse to set the title"
47
+ eval tests.objs.json.out.title = 'Brute Force'
48
+ assert "expected parse to set the title"
51
49
 
52
- eval tests.objs.json.out.meta.author = 'ESR'
53
- assert "expected parse to build the nested meta container"
50
+ eval tests.objs.json.out.meta.author = 'ESR'
51
+ assert "expected parse to build the nested meta container"
54
52
 
55
- set_from_objects_round_trip [test] :
56
- description [string] : set serialises an object tree; get reads it back.
57
- on_test [script] :
58
- # a path inside ( ) params must be absolute, not a ^ ref
59
- tell ^^.built to set ( tests.objs.json.source )
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
- tell ^^.built to get ( 'name' )
62
- eval it = 'gloo'
63
- assert "expected set then get to round-trip a value"
59
+ tell ^^.built to get ( 'name' )
60
+ eval it = 'gloo'
61
+ assert "expected set then get to round-trip a value"
64
62
 
65
- pretty_keeps_it_valid [test] :
66
- description [string] : pretty reformats the text without breaking it.
67
- on_test [script] :
68
- tell ^^.compact to pretty
69
- tell ^^.compact to get ( 'b.c' )
70
- eval it = '2'
71
- assert "expected the value to still be reachable after pretty"
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
- assign_a_json_string_at_run_time [test] :
74
- description [string] : a quote-containing literal can be put into an object at run time.
75
- on_test [script] :
76
- put '{"lang":"gloo","ok":true}' into tests.objs.json.assigned
77
- tell ^^.assigned to get ( 'lang' )
78
- eval it = 'gloo'
79
- assert "expected the run-time JSON string to be assigned and readable"
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
- objs [can] :
7
- obj [can] :
8
-
9
- o [any] :
10
- a [can] :
11
- b [string] : "b"
12
- c [string] : "c"
13
- d [string] : "d"
14
-
15
- obj_contains [test] :
16
- description [string] : Check to see if an object contains children
17
- on_test [script] :
18
- check tests.objs.obj.o for contains?
19
- refute "the object does not contain children"
20
-
21
- check tests.objs.obj.a for contains?
22
- assert "the object contains children"
23
-
24
- blank_object [test] :
25
- description [string] : Check for a blank string
26
- on_test [script] :
27
- check tests.objs.obj.a.b for blank?
28
- refute "the string should be blank"
29
-
30
- check tests.objs.obj.o for blank?
31
- assert "the object should be blank"
32
-
33
- responds_to_blank [test] :
34
- description [string] : Verify that all objects respond to blank? msessage
35
- on_test [script] :
36
- check tests.objs.obj.o for responds_to? ('blank?')
37
- assert "expected any object to respond to blank?"
38
-
39
- responds_to_contains [test] :
40
- description [string] : Verify that all objects respond to contains? msessage
41
- on_test [script] :
42
- check tests.objs.obj.o for responds_to? ('contains?')
43
- assert "expected any object to respond to contains?"
44
-
45
- responds_to_up [test] :
46
- description [string] : Verify that strings respond to up msessage
47
- on_test [script] :
48
- check tests.objs.obj.o for responds_to? ('up')
49
- refute "expected any object to not respond to up"
50
-
51
- check tests.objs.obj.a.b for responds_to? ('up')
52
- assert "expected string to respond to up"
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"