vedeu 0.6.7 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/docs/dsl.md +4 -4
  4. data/lib/vedeu/all.rb +6 -18
  5. data/lib/vedeu/api.rb +14 -13
  6. data/lib/vedeu/bindings/system.rb +5 -4
  7. data/lib/vedeu/buffers/virtual_buffer.rb +13 -11
  8. data/lib/vedeu/configuration/api.rb +4 -3
  9. data/lib/vedeu/cursors/cursor.rb +23 -18
  10. data/lib/vedeu/distributed/client.rb +11 -6
  11. data/lib/vedeu/distributed/server.rb +4 -3
  12. data/lib/vedeu/dsl/keymap.rb +6 -6
  13. data/lib/vedeu/editor/all.rb +19 -0
  14. data/lib/vedeu/{input/editor → editor}/capture.rb +1 -1
  15. data/lib/vedeu/{input/editor → editor}/cropper.rb +0 -0
  16. data/lib/vedeu/{input/editor → editor}/cursor.rb +0 -0
  17. data/lib/vedeu/{input/editor → editor}/document.rb +0 -0
  18. data/lib/vedeu/{input/editor → editor}/documents.rb +0 -0
  19. data/lib/vedeu/{input/editor → editor}/editor.rb +0 -0
  20. data/lib/vedeu/{input/editor → editor}/insert.rb +0 -0
  21. data/lib/vedeu/{input/editor → editor}/line.rb +0 -0
  22. data/lib/vedeu/{input/editor → editor}/lines.rb +0 -0
  23. data/lib/vedeu/error.rb +21 -18
  24. data/lib/vedeu/esc/borders.rb +6 -4
  25. data/lib/vedeu/esc/colours.rb +13 -12
  26. data/lib/vedeu/esc/esc.rb +11 -10
  27. data/lib/vedeu/input/all.rb +15 -0
  28. data/lib/vedeu/input/input.rb +55 -52
  29. data/lib/vedeu/input/key.rb +36 -30
  30. data/lib/vedeu/input/keymap.rb +101 -92
  31. data/lib/vedeu/input/keymaps.rb +10 -6
  32. data/lib/vedeu/input/keys.rb +8 -4
  33. data/lib/vedeu/input/mapper.rb +125 -121
  34. data/lib/vedeu/input/translator.rb +159 -0
  35. data/lib/vedeu/internal_api.rb +16 -15
  36. data/lib/vedeu/logging/all.rb +13 -0
  37. data/lib/vedeu/logging/debug.rb +84 -0
  38. data/lib/vedeu/logging/lockless_log_device.rb +65 -0
  39. data/lib/vedeu/logging/log.rb +179 -0
  40. data/lib/vedeu/logging/mono_logger.rb +26 -0
  41. data/lib/vedeu/logging/timer.rb +68 -0
  42. data/lib/vedeu/menus/all.rb +12 -0
  43. data/lib/vedeu/{dsl/menu.rb → menus/dsl.rb} +19 -18
  44. data/lib/vedeu/menus/menu.rb +234 -0
  45. data/lib/vedeu/{null/menu.rb → menus/null.rb} +6 -6
  46. data/lib/vedeu/menus/repository.rb +18 -0
  47. data/lib/vedeu/models/cell.rb +62 -55
  48. data/lib/vedeu/models/escape.rb +55 -50
  49. data/lib/vedeu/models/page.rb +74 -69
  50. data/lib/vedeu/models/row.rb +55 -51
  51. data/lib/vedeu/models/views/all.rb +1 -0
  52. data/lib/vedeu/models/views/char.rb +1 -1
  53. data/lib/vedeu/models/views/html_char.rb +165 -0
  54. data/lib/vedeu/output/renderers/html.rb +5 -4
  55. data/lib/vedeu/repositories/model.rb +2 -0
  56. data/lib/vedeu/runtime/application.rb +110 -103
  57. data/lib/vedeu/runtime/bootstrap.rb +109 -103
  58. data/lib/vedeu/runtime/flags.rb +45 -41
  59. data/lib/vedeu/runtime/launcher.rb +1 -1
  60. data/lib/vedeu/runtime/main_loop.rb +51 -46
  61. data/lib/vedeu/runtime/traps.rb +20 -16
  62. data/lib/vedeu/version.rb +1 -1
  63. data/lib/vedeu.rb +2 -2
  64. data/test/lib/vedeu/buffers/virtual_buffer_test.rb +1 -1
  65. data/test/lib/vedeu/cursors/cursor_test.rb +11 -5
  66. data/test/lib/vedeu/dsl/interface_test.rb +1 -1
  67. data/test/lib/vedeu/dsl/keymap_test.rb +2 -2
  68. data/test/lib/vedeu/{input/editor → editor}/capture_test.rb +0 -0
  69. data/test/lib/vedeu/{input/editor → editor}/cropper_test.rb +0 -0
  70. data/test/lib/vedeu/{input/editor → editor}/cursor_test.rb +0 -0
  71. data/test/lib/vedeu/{input/editor → editor}/document_test.rb +0 -0
  72. data/test/lib/vedeu/{input/editor → editor}/documents_test.rb +0 -0
  73. data/test/lib/vedeu/{input/editor → editor}/editor_test.rb +0 -0
  74. data/test/lib/vedeu/{input/editor → editor}/insert_test.rb +0 -0
  75. data/test/lib/vedeu/{input/editor → editor}/line_test.rb +0 -0
  76. data/test/lib/vedeu/{input/editor → editor}/lines_test.rb +0 -0
  77. data/test/lib/vedeu/input/input_test.rb +58 -54
  78. data/test/lib/vedeu/input/key_test.rb +29 -25
  79. data/test/lib/vedeu/input/keymap_test.rb +74 -70
  80. data/test/lib/vedeu/input/keymaps_test.rb +8 -4
  81. data/test/lib/vedeu/input/keys_test.rb +12 -8
  82. data/test/lib/vedeu/input/mapper_test.rb +64 -56
  83. data/test/lib/vedeu/input/translator_test.rb +36 -0
  84. data/test/lib/vedeu/logging/debug_test.rb +39 -0
  85. data/test/lib/vedeu/logging/lockless_log_device_test.rb +42 -0
  86. data/test/lib/vedeu/logging/log_test.rb +52 -0
  87. data/test/lib/vedeu/logging/mono_logger_test.rb +43 -0
  88. data/test/lib/vedeu/logging/timer_test.rb +44 -0
  89. data/test/lib/vedeu/{dsl/menu_test.rb → menus/dsl_test.rb} +6 -6
  90. data/test/lib/vedeu/menus/menu_test.rb +305 -0
  91. data/test/lib/vedeu/{null/menu_test.rb → menus/null_test.rb} +5 -5
  92. data/test/lib/vedeu/menus/repository_test.rb +17 -0
  93. data/test/lib/vedeu/models/cell_test.rb +54 -50
  94. data/test/lib/vedeu/models/escape_test.rb +49 -45
  95. data/test/lib/vedeu/models/page_test.rb +167 -160
  96. data/test/lib/vedeu/models/row_test.rb +71 -67
  97. data/test/lib/vedeu/models/views/html_char_test.rb +110 -0
  98. data/test/lib/vedeu/output/compressor_test.rb +44 -22
  99. data/test/lib/vedeu/output/renderers_test.rb +4 -2
  100. data/test/lib/vedeu/runtime/application_test.rb +36 -32
  101. data/test/lib/vedeu/runtime/bootstrap_test.rb +31 -26
  102. data/test/lib/vedeu/runtime/flags_test.rb +33 -29
  103. data/test/lib/vedeu/runtime/launcher_test.rb +4 -2
  104. data/test/lib/vedeu/runtime/main_loop_test.rb +28 -24
  105. data/test/lib/vedeu/runtime/traps_test.rb +8 -4
  106. data/test/test_helper.rb +4 -2
  107. metadata +66 -63
  108. data/lib/vedeu/input/editor/all.rb +0 -19
  109. data/lib/vedeu/input/input_translator.rb +0 -155
  110. data/lib/vedeu/log/debug.rb +0 -79
  111. data/lib/vedeu/log/lockless_log_device.rb +0 -61
  112. data/lib/vedeu/log/log.rb +0 -172
  113. data/lib/vedeu/log/mono_logger.rb +0 -21
  114. data/lib/vedeu/log/timer.rb +0 -63
  115. data/lib/vedeu/models/menu.rb +0 -217
  116. data/lib/vedeu/models/menus.rb +0 -14
  117. data/lib/vedeu/output/html_char.rb +0 -161
  118. data/test/lib/vedeu/input/input_translator_test.rb +0 -32
  119. data/test/lib/vedeu/log/debug_test.rb +0 -35
  120. data/test/lib/vedeu/log/lockless_log_device_test.rb +0 -29
  121. data/test/lib/vedeu/log/log_test.rb +0 -48
  122. data/test/lib/vedeu/log/mono_logger_test.rb +0 -31
  123. data/test/lib/vedeu/log/timer_test.rb +0 -40
  124. data/test/lib/vedeu/models/menu_test.rb +0 -301
  125. data/test/lib/vedeu/models/menus_test.rb +0 -13
  126. data/test/lib/vedeu/output/html_char_test.rb +0 -106
@@ -2,234 +2,241 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
- describe Page do
5
+ module Models
6
6
 
7
- let(:described) { Vedeu::Page }
8
- let(:instance) { described.new(rows) }
9
- let(:rows) {
10
- [
11
- [:hydrogen, :helium, :lithium],
12
- [:beryllium, :boron, :carbon],
13
- [:nitrogen, :oxygen, :fluorine],
14
- ]
15
- }
7
+ describe Page do
16
8
 
17
- describe '#initialize' do
18
- it { instance.must_be_instance_of(described) }
9
+ let(:described) { Vedeu::Models::Page }
10
+ let(:instance) { described.new(rows) }
11
+ let(:rows) {
12
+ [
13
+ [:hydrogen, :helium, :lithium],
14
+ [:beryllium, :boron, :carbon],
15
+ [:nitrogen, :oxygen, :fluorine],
16
+ ]
17
+ }
19
18
 
20
- context 'when there are no rows' do
21
- let(:rows) {}
19
+ describe '#initialize' do
20
+ it { instance.must_be_instance_of(described) }
22
21
 
23
- it { instance.instance_variable_get('@rows').must_equal([]) }
24
- end
25
-
26
- context 'when there are rows' do
27
- it { instance.instance_variable_get('@rows').must_equal(rows) }
28
- end
29
- end
22
+ context 'when there are no rows' do
23
+ let(:rows) {}
30
24
 
31
- describe '.coerce' do
32
- let(:_value) {}
25
+ it { instance.instance_variable_get('@rows').must_equal([]) }
26
+ end
33
27
 
34
- subject { described.coerce(_value) }
28
+ context 'when there are rows' do
29
+ it { instance.instance_variable_get('@rows').must_equal(rows) }
30
+ end
31
+ end
35
32
 
36
- it { proc { subject }.must_raise(Vedeu::Error::InvalidSyntax) }
33
+ describe '.coerce' do
34
+ let(:_value) {}
37
35
 
38
- context 'when the value is a Vedeu::Page' do
39
- let(:_value) { Vedeu::Page.new }
36
+ subject { described.coerce(_value) }
40
37
 
41
- it { subject.must_equal(_value) }
42
- end
38
+ it { proc { subject }.must_raise(Vedeu::Error::InvalidSyntax) }
43
39
 
44
- context 'when the value is a Vedeu::Row' do
45
- let(:_value) { Vedeu::Row.new }
46
- let(:expected) { Vedeu::Page.new([_value]) }
40
+ context 'when the value is a Vedeu::Models::Page' do
41
+ let(:_value) { described.new }
47
42
 
48
- it { subject.must_equal(expected) }
49
- end
43
+ it { subject.must_equal(_value) }
44
+ end
50
45
 
51
- context 'when the value is an Array' do
52
- context 'and the value is empty' do
53
- let(:_value) { [] }
54
- let(:expected) { Vedeu::Page.coerce(Vedeu::Row.coerce(_value)) }
46
+ context 'when the value is a Vedeu::Models::Row' do
47
+ let(:_value) { Vedeu::Models::Row.new }
48
+ let(:expected) { described.new([_value]) }
55
49
 
56
- it { subject.must_be_instance_of(Vedeu::Page) }
57
50
  it { subject.must_equal(expected) }
58
51
  end
59
52
 
60
- context 'and the value is not empty, the content is' do
61
- context 'is an empty Array' do
62
- let(:_value) { [[]] }
63
- let(:expected) { Vedeu::Page.coerce(Vedeu::Row.coerce([])) }
53
+ context 'when the value is an Array' do
54
+ context 'and the value is empty' do
55
+ let(:_value) { [] }
56
+ let(:expected) {
57
+ described.coerce(Vedeu::Models::Row.coerce(_value))
58
+ }
64
59
 
65
- it { subject.must_be_instance_of(Vedeu::Page) }
60
+ it { subject.must_be_instance_of(described) }
66
61
  it { subject.must_equal(expected) }
67
62
  end
68
63
 
69
- context 'an array of Vedeu::Row objects' do
70
- let(:_value) {
71
- [
72
- Vedeu::Row.new([:hydrogen, :helium]),
73
- Vedeu::Row.new([:lithium, :beryllium]),
74
- ]
75
- }
76
- let(:expected) { Vedeu::Page.new(_value) }
64
+ context 'and the value is not empty, the content is' do
65
+ context 'is an empty Array' do
66
+ let(:_value) { [[]] }
67
+ let(:expected) { described.coerce(Vedeu::Models::Row.coerce([])) }
77
68
 
78
- it { subject.must_equal(expected) }
79
- end
69
+ it { subject.must_be_instance_of(described) }
70
+ it { subject.must_equal(expected) }
71
+ end
80
72
 
81
- context 'a mix of Vedeu::Row objects and other objects' do
82
- let(:_value) {
83
- [
84
- Vedeu::Row.new([:hydrogen, :helium]),
85
- [:lithium],
86
- Vedeu::Row.new([:beryllium, :boron]),
87
- ]
88
- }
89
- let(:expected) {
90
- Vedeu::Page.new([
91
- Vedeu::Row.new([:hydrogen, :helium]),
92
- Vedeu::Row.new([:lithium]),
93
- Vedeu::Row.new([:beryllium, :boron]),
94
- ])
95
- }
73
+ context 'an array of Vedeu::Models::Row objects' do
74
+ let(:_value) {
75
+ [
76
+ Vedeu::Models::Row.new([:hydrogen, :helium]),
77
+ Vedeu::Models::Row.new([:lithium, :beryllium]),
78
+ ]
79
+ }
80
+ let(:expected) { described.new(_value) }
96
81
 
97
- it { subject.must_equal(expected) }
98
- end
82
+ it { subject.must_equal(expected) }
83
+ end
99
84
 
100
- context 'a mix of Vedeu::Row objects, other objects and nils' do
101
- let(:_value) {
102
- [
103
- Vedeu::Row.new([:hydrogen, :helium]),
104
- nil,
105
- [:lithium],
106
- Vedeu::Row.new([:beryllium, :boron]),
107
- [nil, :carbon],
108
- ]
109
- }
110
- let(:expected) {
111
- Vedeu::Page.new([
112
- Vedeu::Row.new([:hydrogen, :helium]),
113
- Vedeu::Row.new([]),
114
- Vedeu::Row.new([:lithium]),
115
- Vedeu::Row.new([:beryllium, :boron]),
116
- Vedeu::Row.new([:carbon]),
117
- ])
118
- }
85
+ context 'a mix of Vedeu::Models::Row objects and other objects' do
86
+ let(:_value) {
87
+ [
88
+ Vedeu::Models::Row.new([:hydrogen, :helium]),
89
+ [:lithium],
90
+ Vedeu::Models::Row.new([:beryllium, :boron]),
91
+ ]
92
+ }
93
+ let(:expected) {
94
+ described.new([
95
+ Vedeu::Models::Row.new([:hydrogen, :helium]),
96
+ Vedeu::Models::Row.new([:lithium]),
97
+ Vedeu::Models::Row.new([:beryllium, :boron]),
98
+ ])
99
+ }
100
+
101
+ it { subject.must_equal(expected) }
102
+ end
103
+
104
+ context 'a mix of Vedeu::Models::Row objects, other objects and ' \
105
+ 'nils' do
106
+ let(:_value) {
107
+ [
108
+ Vedeu::Models::Row.new([:hydrogen, :helium]),
109
+ nil,
110
+ [:lithium],
111
+ Vedeu::Models::Row.new([:beryllium, :boron]),
112
+ [nil, :carbon],
113
+ ]
114
+ }
115
+ let(:expected) {
116
+ described.new([
117
+ Vedeu::Models::Row.new([:hydrogen, :helium]),
118
+ Vedeu::Models::Row.new([]),
119
+ Vedeu::Models::Row.new([:lithium]),
120
+ Vedeu::Models::Row.new([:beryllium, :boron]),
121
+ Vedeu::Models::Row.new([:carbon]),
122
+ ])
123
+ }
124
+
125
+ it { subject.must_equal(expected) }
126
+ end
119
127
 
120
- it { subject.must_equal(expected) }
121
128
  end
122
129
 
123
130
  end
124
-
125
131
  end
126
- end
127
132
 
128
- describe '#each' do
129
- subject { instance.each }
133
+ describe '#each' do
134
+ subject { instance.each }
130
135
 
131
- it { subject.must_be_instance_of(Enumerator) }
132
- end
136
+ it { subject.must_be_instance_of(Enumerator) }
137
+ end
133
138
 
134
- describe '#eql?' do
135
- let(:other) { instance }
139
+ describe '#eql?' do
140
+ let(:other) { instance }
136
141
 
137
- subject { instance.eql?(other) }
142
+ subject { instance.eql?(other) }
138
143
 
139
- it { subject.must_equal(true) }
144
+ it { subject.must_equal(true) }
140
145
 
141
- context 'when different to other' do
142
- let(:other) { described.new([:hydrogen]) }
146
+ context 'when different to other' do
147
+ let(:other) { described.new([:hydrogen]) }
143
148
 
144
- it { subject.must_equal(false) }
149
+ it { subject.must_equal(false) }
150
+ end
145
151
  end
146
- end
147
152
 
148
- describe '#row' do
149
- let(:index) {}
153
+ describe '#row' do
154
+ let(:index) {}
150
155
 
151
- subject { instance.row(index) }
156
+ subject { instance.row(index) }
152
157
 
153
- context 'when the index is nil' do
154
- it { subject.must_equal(nil) }
155
- end
158
+ context 'when the index is nil' do
159
+ it { subject.must_equal(nil) }
160
+ end
156
161
 
157
- context 'when the index is not nil' do
158
- context 'and the index is in range' do
159
- let(:index) { 1 }
162
+ context 'when the index is not nil' do
163
+ context 'and the index is in range' do
164
+ let(:index) { 1 }
160
165
 
161
- it { subject.must_equal([:beryllium, :boron, :carbon]) }
162
- end
166
+ it { subject.must_equal([:beryllium, :boron, :carbon]) }
167
+ end
163
168
 
164
- context 'and the index is out of range' do
165
- let(:index) { 4 }
169
+ context 'and the index is out of range' do
170
+ let(:index) { 4 }
166
171
 
167
- it { subject.must_equal(nil) }
168
- end
172
+ it { subject.must_equal(nil) }
173
+ end
169
174
 
170
- context 'and the index is out of range' do
171
- let(:index) { -4 }
175
+ context 'and the index is out of range' do
176
+ let(:index) { -4 }
172
177
 
173
- it { subject.must_equal(nil) }
178
+ it { subject.must_equal(nil) }
179
+ end
174
180
  end
175
181
  end
176
- end
177
182
 
178
- describe '#cell' do
179
- let(:row_index) {}
180
- let(:cell_index) {}
183
+ describe '#cell' do
184
+ let(:row_index) {}
185
+ let(:cell_index) {}
181
186
 
182
- subject { instance.cell(row_index, cell_index) }
183
-
184
- context 'when the row_index is nil' do
185
- it { subject.must_equal(nil) }
186
- end
187
+ subject { instance.cell(row_index, cell_index) }
187
188
 
188
- context 'when the row_index is not nil' do
189
- let(:row_index) { 1 }
189
+ context 'when the row_index is nil' do
190
+ it { subject.must_equal(nil) }
191
+ end
190
192
 
191
- context 'and the row_index is in range' do
193
+ context 'when the row_index is not nil' do
192
194
  let(:row_index) { 1 }
193
195
 
194
- context 'when the cell_index is nil' do
195
- it { subject.must_equal(nil) }
196
- end
197
-
198
- context 'when the cell_index is not nil' do
199
- context 'and the cell_index is in range' do
200
- let(:cell_index) { 2 }
196
+ context 'and the row_index is in range' do
197
+ let(:row_index) { 1 }
201
198
 
202
- it { subject.must_equal(:carbon) }
199
+ context 'when the cell_index is nil' do
200
+ it { subject.must_equal(nil) }
203
201
  end
204
202
 
205
- context 'and the cell_index is out of range' do
206
- let(:cell_index) { 4 }
203
+ context 'when the cell_index is not nil' do
204
+ context 'and the cell_index is in range' do
205
+ let(:cell_index) { 2 }
207
206
 
208
- it { subject.must_equal(nil) }
209
- end
207
+ it { subject.must_equal(:carbon) }
208
+ end
210
209
 
211
- context 'and the cell_index is out of range' do
212
- let(:cell_index) { -4 }
210
+ context 'and the cell_index is out of range' do
211
+ let(:cell_index) { 4 }
213
212
 
214
- it { subject.must_equal(nil) }
213
+ it { subject.must_equal(nil) }
214
+ end
215
+
216
+ context 'and the cell_index is out of range' do
217
+ let(:cell_index) { -4 }
218
+
219
+ it { subject.must_equal(nil) }
220
+ end
215
221
  end
216
222
  end
217
- end
218
223
 
219
- context 'and the row_index is out of range' do
220
- let(:row_index) { 4 }
224
+ context 'and the row_index is out of range' do
225
+ let(:row_index) { 4 }
221
226
 
222
- it { subject.must_equal(nil) }
223
- end
227
+ it { subject.must_equal(nil) }
228
+ end
224
229
 
225
- context 'and the row_index is out of range' do
226
- let(:row_index) { -4 }
230
+ context 'and the row_index is out of range' do
231
+ let(:row_index) { -4 }
227
232
 
228
- it { subject.must_equal(nil) }
233
+ it { subject.must_equal(nil) }
234
+ end
229
235
  end
230
236
  end
231
- end
232
237
 
233
- end # Page
238
+ end # Page
239
+
240
+ end # Models
234
241
 
235
242
  end # Vedeu
@@ -2,110 +2,114 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
- describe Row do
5
+ module Models
6
6
 
7
- let(:described) { Vedeu::Row }
8
- let(:instance) { described.new(cells) }
9
- let(:cells) { [:hydrogen, :helium, :lithium] }
7
+ describe Row do
10
8
 
11
- describe '#initialize' do
12
- it { instance.must_be_instance_of(described) }
9
+ let(:described) { Vedeu::Models::Row }
10
+ let(:instance) { described.new(cells) }
11
+ let(:cells) { [:hydrogen, :helium, :lithium] }
13
12
 
14
- context 'when there are no cells' do
15
- let(:cells) {}
13
+ describe '#initialize' do
14
+ it { instance.must_be_instance_of(described) }
16
15
 
17
- it { instance.instance_variable_get('@cells').must_equal([]) }
18
- end
16
+ context 'when there are no cells' do
17
+ let(:cells) {}
18
+
19
+ it { instance.instance_variable_get('@cells').must_equal([]) }
20
+ end
19
21
 
20
- context 'when there are cells' do
21
- it { instance.instance_variable_get('@cells').must_equal(cells) }
22
+ context 'when there are cells' do
23
+ it { instance.instance_variable_get('@cells').must_equal(cells) }
24
+ end
22
25
  end
23
- end
24
26
 
25
- describe '.coerce' do
26
- subject { described.coerce(_value) }
27
+ describe '.coerce' do
28
+ subject { described.coerce(_value) }
27
29
 
28
- context 'when the value is a Vedeu::Row' do
29
- let(:_value) { Vedeu::Row.new }
30
+ context 'when the value is a Vedeu::Models::Row' do
31
+ let(:_value) { described.new }
30
32
 
31
- it { subject.must_equal(_value) }
32
- end
33
+ it { subject.must_equal(_value) }
34
+ end
33
35
 
34
- context 'when the value is an Array' do
35
- let(:_value) { [:hydrogen, :helium, :lithium] }
36
+ context 'when the value is an Array' do
37
+ let(:_value) { [:hydrogen, :helium, :lithium] }
36
38
 
37
- it { subject.must_equal(Vedeu::Row.new(_value)) }
38
- end
39
+ it { subject.must_equal(described.new(_value)) }
40
+ end
39
41
 
40
- context 'when the value is an Array containing nil objects' do
41
- let(:_value) { [:hydrogen, nil, :lithium] }
42
+ context 'when the value is an Array containing nil objects' do
43
+ let(:_value) { [:hydrogen, nil, :lithium] }
42
44
 
43
- it { subject.must_equal(Vedeu::Row.new([:hydrogen, :lithium])) }
44
- end
45
+ it { subject.must_equal(described.new([:hydrogen, :lithium])) }
46
+ end
45
47
 
46
- context 'when the value is nil' do
47
- let(:_value) {}
48
+ context 'when the value is nil' do
49
+ let(:_value) {}
48
50
 
49
- it { subject.must_equal(Vedeu::Row.new) }
50
- end
51
+ it { subject.must_equal(described.new) }
52
+ end
51
53
 
52
- context 'when the value is anything else' do
53
- let(:_value) { :beryllium }
54
+ context 'when the value is anything else' do
55
+ let(:_value) { :beryllium }
54
56
 
55
- it { subject.must_equal(Vedeu::Row.new([_value])) }
57
+ it { subject.must_equal(described.new([_value])) }
58
+ end
56
59
  end
57
- end
58
60
 
59
- describe '#each' do
60
- subject { instance.each }
61
+ describe '#each' do
62
+ subject { instance.each }
61
63
 
62
- it { subject.must_be_instance_of(Enumerator) }
63
- end
64
+ it { subject.must_be_instance_of(Enumerator) }
65
+ end
64
66
 
65
- describe '#eql?' do
66
- let(:other) { instance }
67
+ describe '#eql?' do
68
+ let(:other) { instance }
67
69
 
68
- subject { instance.eql?(other) }
70
+ subject { instance.eql?(other) }
69
71
 
70
- it { subject.must_equal(true) }
72
+ it { subject.must_equal(true) }
71
73
 
72
- context 'when different to other' do
73
- let(:other) { described.new([:hydrogen]) }
74
+ context 'when different to other' do
75
+ let(:other) { described.new([:hydrogen]) }
74
76
 
75
- it { subject.must_equal(false) }
77
+ it { subject.must_equal(false) }
78
+ end
76
79
  end
77
- end
78
80
 
79
- describe '#cell' do
80
- let(:index) {}
81
+ describe '#cell' do
82
+ let(:index) {}
81
83
 
82
- subject { instance.cell(index) }
84
+ subject { instance.cell(index) }
83
85
 
84
- context 'when the index is nil' do
85
- it { subject.must_equal(nil) }
86
- end
86
+ context 'when the index is nil' do
87
+ it { subject.must_equal(nil) }
88
+ end
87
89
 
88
- context 'when the index is not nil' do
89
- context 'and the index is in range' do
90
- let(:index) { 1 }
90
+ context 'when the index is not nil' do
91
+ context 'and the index is in range' do
92
+ let(:index) { 1 }
91
93
 
92
- it { subject.must_equal(:helium) }
93
- end
94
+ it { subject.must_equal(:helium) }
95
+ end
94
96
 
95
- context 'and the index is out of range' do
96
- let(:index) { 4 }
97
+ context 'and the index is out of range' do
98
+ let(:index) { 4 }
97
99
 
98
- it { subject.must_equal(nil) }
99
- end
100
+ it { subject.must_equal(nil) }
101
+ end
100
102
 
101
- context 'and the index is out of range' do
102
- let(:index) { -4 }
103
+ context 'and the index is out of range' do
104
+ let(:index) { -4 }
103
105
 
104
- it { subject.must_equal(nil) }
106
+ it { subject.must_equal(nil) }
107
+ end
105
108
  end
106
109
  end
107
- end
108
110
 
109
- end # Row
111
+ end # Row
112
+
113
+ end # Models
110
114
 
111
115
  end # Vedeu