gloo 6.3.1 → 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.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/CLAUDE.md +13 -0
  3. data/docs/application.md +9 -0
  4. data/docs/language_objects.md +78 -0
  5. data/docs/language_scripting.md +41 -0
  6. data/docs/objects.md +1 -1
  7. data/docs/verbs.md +36 -2
  8. data/lib/VERSION +1 -1
  9. data/lib/VERSION_NOTES +13 -0
  10. data/lib/gloo/app/engine.rb +5 -1
  11. data/lib/gloo/app/log.rb +5 -5
  12. data/lib/gloo/app/settings.rb +4 -1
  13. data/lib/gloo/core/obj.rb +60 -1
  14. data/lib/gloo/core/parser.rb +30 -1
  15. data/lib/gloo/core/tokens.rb +44 -18
  16. data/lib/gloo/expr/l_string.rb +8 -4
  17. data/lib/gloo/objs/basic/script.rb +28 -2
  18. data/lib/gloo/objs/web/json.rb +4 -1
  19. data/lib/gloo/persist/comment_buffer.rb +58 -0
  20. data/lib/gloo/persist/declaration_ledger.rb +61 -0
  21. data/lib/gloo/persist/disc_mech.rb +15 -2
  22. data/lib/gloo/persist/file_loader.rb +208 -102
  23. data/lib/gloo/persist/file_saver.rb +251 -6
  24. data/lib/gloo/persist/file_storage.rb +10 -4
  25. data/lib/gloo/persist/indent_stack.rb +90 -0
  26. data/lib/gloo/persist/line_splitter.rb +18 -3
  27. data/lib/gloo/persist/persist_man.rb +193 -26
  28. data/lib/gloo/persist/script_body_collector.rb +102 -0
  29. data/lib/gloo/persist/shorthand_expander.rb +51 -0
  30. data/lib/gloo/persist/source/blank_node.rb +27 -0
  31. data/lib/gloo/persist/source/comment_node.rb +27 -0
  32. data/lib/gloo/persist/source/directive_node.rb +26 -0
  33. data/lib/gloo/persist/source/obj_node.rb +91 -0
  34. data/lib/gloo/persist/source/source_doc.rb +41 -0
  35. data/lib/gloo/verbs/list.rb +24 -2
  36. data/lib/gloo/verbs/load.rb +9 -1
  37. data/lib/gloo/verbs/reload.rb +3 -0
  38. data/lib/gloo/verbs/save.rb +57 -10
  39. data/test.gloo/ctrl/each.test.gloo +28 -30
  40. data/test.gloo/dt/date.test.gloo +69 -71
  41. data/test.gloo/dt/datetime.test.gloo +55 -57
  42. data/test.gloo/dt/time.test.gloo +70 -72
  43. data/test.gloo/lang/continuation.test.gloo +25 -27
  44. data/test.gloo/lang/convert.test.gloo +50 -52
  45. data/test.gloo/lang/dt_comparisons.test.gloo +87 -89
  46. data/test.gloo/lang/exceptions.test.gloo +42 -44
  47. data/test.gloo/lang/gloo_sys.test.gloo +100 -102
  48. data/test.gloo/lang/here.test.gloo +32 -34
  49. data/test.gloo/lang/it.test.gloo +27 -29
  50. data/test.gloo/lang/literal.test.gloo +55 -57
  51. data/test.gloo/lang/load_lib_directive.test.gloo +18 -20
  52. data/test.gloo/lang/naming.test.gloo +28 -30
  53. data/test.gloo/lang/ops.test.gloo +53 -55
  54. data/test.gloo/lang/shorthand.test.gloo +27 -0
  55. data/test.gloo/math/add.test.gloo +40 -42
  56. data/test.gloo/math/div.test.gloo +23 -25
  57. data/test.gloo/math/mult.test.gloo +23 -25
  58. data/test.gloo/math/sub.test.gloo +23 -25
  59. data/test.gloo/objs/alias.test.gloo +15 -17
  60. data/test.gloo/objs/bool.test.gloo +54 -56
  61. data/test.gloo/objs/can.test.gloo +33 -35
  62. data/test.gloo/objs/cipher.test.gloo +39 -41
  63. data/test.gloo/objs/decimal.test.gloo +27 -29
  64. data/test.gloo/objs/erb.test.gloo +47 -49
  65. data/test.gloo/objs/file.test.gloo +68 -70
  66. data/test.gloo/objs/function.test.gloo +37 -39
  67. data/test.gloo/objs/int.test.gloo +54 -56
  68. data/test.gloo/objs/json.test.gloo +57 -50
  69. data/test.gloo/objs/obj.test.gloo +68 -48
  70. data/test.gloo/objs/outline.test.gloo +48 -50
  71. data/test.gloo/objs/password.test.gloo +34 -36
  72. data/test.gloo/objs/repeat.test.gloo +42 -44
  73. data/test.gloo/objs/script.test.gloo +13 -15
  74. data/test.gloo/objs/string.test.gloo +82 -84
  75. data/test.gloo/objs/text.test.gloo +90 -92
  76. data/test.gloo/objs/untyped.test.gloo +36 -38
  77. data/test.gloo/objs/uri.test.gloo +37 -39
  78. data/test.gloo/string/str.test.gloo +15 -0
  79. data/test.gloo/verbs/break.test.gloo +12 -14
  80. data/test.gloo/verbs/check.test.gloo +22 -24
  81. data/test.gloo/verbs/context.test.gloo +11 -13
  82. data/test.gloo/verbs/create.test.gloo +7 -9
  83. data/test.gloo/verbs/eval.test.gloo +10 -12
  84. data/test.gloo/verbs/exists.test.gloo +43 -45
  85. data/test.gloo/verbs/if.test.gloo +8 -10
  86. data/test.gloo/verbs/invoke.test.gloo +73 -75
  87. data/test.gloo/verbs/list.test.gloo +21 -23
  88. data/test.gloo/verbs/load.test.gloo +27 -21
  89. data/test.gloo/verbs/log.test.gloo +7 -9
  90. data/test.gloo/verbs/move.test.gloo +12 -14
  91. data/test.gloo/verbs/put.test.gloo +10 -12
  92. data/test.gloo/verbs/reload.test.gloo +55 -0
  93. data/test.gloo/verbs/run.test.gloo +8 -10
  94. data/test.gloo/verbs/save.test.gloo +111 -0
  95. data/test.gloo/verbs/show.test.gloo +26 -28
  96. data/test.gloo/verbs/tell.test.gloo +8 -10
  97. data/test.gloo/verbs/throw.test.gloo +31 -33
  98. data/test.gloo/verbs/unless.test.gloo +13 -15
  99. data/test.gloo/verbs/unload.test.gloo +10 -12
  100. metadata +14 -1
@@ -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,69 +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] :
18
+ built [json] :
19
+ out [can] :
20
+ found [string] :
21
+ assigned [json] :
23
22
 
24
- get_a_value [test] :
25
- description [string] : get pulls a value out by dotted path.
26
- on_test [script] :
27
- tell ^^.payload to get ( 'title' )
28
- eval it = 'Brute Force'
29
- 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"
30
29
 
31
- tell ^^.payload to get ( 'meta.author' )
32
- eval it = 'ESR'
33
- assert "expected the nested author"
30
+ tell ^^.payload to get ( 'meta.author' )
31
+ eval it = 'ESR'
32
+ assert "expected the nested author"
34
33
 
35
- get_missing_is_blank [test] :
36
- description [string] : get for a path that isn't there returns blank.
37
- on_test [script] :
38
- tell ^^.payload to get ( 'nope' )
39
- put it into tests.objs.json.found
40
- check tests.objs.json.found for blank?
41
- 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"
42
41
 
43
- parse_into_objects [test] :
44
- description [string] : parse builds an object tree from the JSON.
45
- on_test [script] :
46
- 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 )
47
46
 
48
- eval tests.objs.json.out.title = 'Brute Force'
49
- assert "expected parse to set the title"
47
+ eval tests.objs.json.out.title = 'Brute Force'
48
+ assert "expected parse to set the title"
50
49
 
51
- eval tests.objs.json.out.meta.author = 'ESR'
52
- 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"
53
52
 
54
- set_from_objects_round_trip [test] :
55
- description [string] : set serialises an object tree; get reads it back.
56
- on_test [script] :
57
- # a path inside ( ) params must be absolute, not a ^ ref
58
- 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 )
59
58
 
60
- tell ^^.built to get ( 'name' )
61
- eval it = 'gloo'
62
- 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"
63
62
 
64
- pretty_keeps_it_valid [test] :
65
- description [string] : pretty reformats the text without breaking it.
66
- on_test [script] :
67
- tell ^^.compact to pretty
68
- tell ^^.compact to get ( 'b.c' )
69
- eval it = '2'
70
- 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"
70
+
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"
@@ -6,67 +6,65 @@
6
6
  # child is the id and whose second child is the name.
7
7
  #
8
8
 
9
- tests [can] :
10
- objs [can] :
11
- outline [can] :
9
+ tests.objs.outline [can] :
12
10
 
13
- src [container] :
14
- 1 [container] :
15
- id [int] : 1
16
- name [string] : a/b/c
17
- 2 [container] :
18
- id [int] : 2
19
- name [string] : a/b/d
20
- 3 [container] :
21
- id [int] : 3
22
- name [string] : top
11
+ src [container] :
12
+ 1 [container] :
13
+ id [int] : 1
14
+ name [string] : a/b/c
15
+ 2 [container] :
16
+ id [int] : 2
17
+ name [string] : a/b/d
18
+ 3 [container] :
19
+ id [int] : 3
20
+ name [string] : top
23
21
 
24
- dotted [container] :
25
- 1 [container] :
26
- id [int] : 9
27
- name [string] : x.y.z
22
+ dotted [container] :
23
+ 1 [container] :
24
+ id [int] : 9
25
+ name [string] : x.y.z
28
26
 
29
- linked [outline] :
30
- object_source [alias] : tests.objs.outline.src
31
- entity_path [string] : /entity/
32
- separator_char [string] : /
33
- data [string] :
27
+ linked [outline] :
28
+ object_source [alias] : tests.objs.outline.src
29
+ entity_path [string] : /entity/
30
+ separator_char [string] : /
31
+ data [string] :
34
32
 
35
- plain [outline] :
36
- object_source [alias] : tests.objs.outline.dotted
37
- separator_char [string] : .
38
- data [string] :
33
+ plain [outline] :
34
+ object_source [alias] : tests.objs.outline.dotted
35
+ separator_char [string] : .
36
+ data [string] :
39
37
 
40
- builds_nested_html_with_links [test] :
41
- description [string] : generate nests shared path segments and links leaves that have an id.
42
- on_test [script] :
43
- tell ^^.linked to generate
38
+ builds_nested_html_with_links [test] :
39
+ description [string] : generate nests shared path segments and links leaves that have an id.
40
+ on_test [script] :
41
+ tell ^^.linked to generate
44
42
 
45
- check ^^.linked.data for starts_with? ( "<ul>" )
46
- assert "expected the outline to start with <ul>"
43
+ check ^^.linked.data for starts_with? ( "<ul>" )
44
+ assert "expected the outline to start with <ul>"
47
45
 
48
- check ^^.linked.data for substring? ( "<li>a</li>" )
49
- assert "expected a shared 'a' segment as a plain node"
46
+ check ^^.linked.data for substring? ( "<li>a</li>" )
47
+ assert "expected a shared 'a' segment as a plain node"
50
48
 
51
- check ^^.linked.data for substring? ( "<li>b</li>" )
52
- assert "expected a shared 'b' segment as a plain node"
49
+ check ^^.linked.data for substring? ( "<li>b</li>" )
50
+ assert "expected a shared 'b' segment as a plain node"
53
51
 
54
- check ^^.linked.data for substring? ( "<a href='/entity/1'>c</a>" )
55
- assert "expected leaf 'c' to be linked with its id and entity_path"
52
+ check ^^.linked.data for substring? ( "<a href='/entity/1'>c</a>" )
53
+ assert "expected leaf 'c' to be linked with its id and entity_path"
56
54
 
57
- check ^^.linked.data for substring? ( "<a href='/entity/3'>top</a>" )
58
- assert "expected the top-level 'top' item to be linked"
55
+ check ^^.linked.data for substring? ( "<a href='/entity/3'>top</a>" )
56
+ assert "expected the top-level 'top' item to be linked"
59
57
 
60
- custom_separator_and_no_links [test] :
61
- description [string] : separator_char sets the split char; with no entity_path leaves are plain.
62
- on_test [script] :
63
- tell ^^.plain to generate
58
+ custom_separator_and_no_links [test] :
59
+ description [string] : separator_char sets the split char; with no entity_path leaves are plain.
60
+ on_test [script] :
61
+ tell ^^.plain to generate
64
62
 
65
- check ^^.plain.data for substring? ( "<li>x</li>" )
66
- assert "expected '.' to split x.y.z so 'x' is its own node"
63
+ check ^^.plain.data for substring? ( "<li>x</li>" )
64
+ assert "expected '.' to split x.y.z so 'x' is its own node"
67
65
 
68
- check ^^.plain.data for substring? ( "<li>z</li>" )
69
- assert "expected leaf 'z' rendered plain (no entity_path)"
66
+ check ^^.plain.data for substring? ( "<li>z</li>" )
67
+ assert "expected leaf 'z' rendered plain (no entity_path)"
70
68
 
71
- check ^^.plain.data for substring? ( "href" )
72
- refute "expected no links when entity_path is not set"
69
+ check ^^.plain.data for substring? ( "href" )
70
+ refute "expected no links when entity_path is not set"
@@ -2,39 +2,37 @@
2
2
  # Password object tests
3
3
  #
4
4
 
5
- tests [can] :
6
- objs [can] :
7
- password [can] :
8
-
9
- hash_and_check [test] :
10
- description [string] : check succeeds for the right password and fails for the wrong one.
11
- on_test [script] :
12
- create tests.objs.password.p as password
13
- put 'user-1' into tests.objs.password.p.salt
14
- put 's3cret' into tests.objs.password.p.password
15
- tell tests.objs.password.p to hash
16
-
17
- check tests.objs.password.p.hash for blank?
18
- refute "expected hash to be populated"
19
-
20
- tell tests.objs.password.p to check
21
- assert "expected check to pass for the original password"
22
-
23
- put 'not the password' into tests.objs.password.p.password
24
- tell tests.objs.password.p to check
25
- refute "expected check to fail for a wrong password"
26
-
27
- generate_length [test] :
28
- description [string] : generate makes a password of the requested length and puts it in it.
29
- on_test [script] :
30
- create tests.objs.password.g as password
31
-
32
- tell tests.objs.password.g to generate
33
- tell tests.objs.password.g.password to size
34
- eval it = 7
35
- assert "expected the default generated length to be 7"
36
-
37
- tell tests.objs.password.g to generate ( 20 )
38
- tell tests.objs.password.g.password to size
39
- eval it = 20
40
- assert "expected the generated length to be 20"
5
+ tests.objs.password [can] :
6
+
7
+ hash_and_check [test] :
8
+ description [string] : check succeeds for the right password and fails for the wrong one.
9
+ on_test [script] :
10
+ create tests.objs.password.p as password
11
+ put 'user-1' into tests.objs.password.p.salt
12
+ put 's3cret' into tests.objs.password.p.password
13
+ tell tests.objs.password.p to hash
14
+
15
+ check tests.objs.password.p.hash for blank?
16
+ refute "expected hash to be populated"
17
+
18
+ tell tests.objs.password.p to check
19
+ assert "expected check to pass for the original password"
20
+
21
+ put 'not the password' into tests.objs.password.p.password
22
+ tell tests.objs.password.p to check
23
+ refute "expected check to fail for a wrong password"
24
+
25
+ generate_length [test] :
26
+ description [string] : generate makes a password of the requested length and puts it in it.
27
+ on_test [script] :
28
+ create tests.objs.password.g as password
29
+
30
+ tell tests.objs.password.g to generate
31
+ tell tests.objs.password.g.password to size
32
+ eval it = 7
33
+ assert "expected the default generated length to be 7"
34
+
35
+ tell tests.objs.password.g to generate ( 20 )
36
+ tell tests.objs.password.g.password to size
37
+ eval it = 20
38
+ assert "expected the generated length to be 20"