vedeu 0.0.38 → 0.0.39

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 (36) hide show
  1. checksums.yaml +4 -4
  2. data/deps.md +24 -11
  3. data/lib/vedeu/input/input.rb +2 -2
  4. data/lib/vedeu/launcher.rb +2 -0
  5. data/lib/vedeu/models/builders/builder.rb +41 -0
  6. data/lib/vedeu/models/builders/command_builder.rb +4 -25
  7. data/lib/vedeu/models/builders/interface_builder.rb +6 -26
  8. data/lib/vedeu/models/interface.rb +2 -2
  9. data/lib/vedeu/output/clear_interface.rb +10 -2
  10. data/lib/vedeu/parsing/text_adaptor.rb +7 -3
  11. data/lib/vedeu/repository/command_repository.rb +6 -6
  12. data/lib/vedeu/repository/interface_repository.rb +2 -18
  13. data/lib/vedeu/repository/repository.rb +25 -9
  14. data/lib/vedeu/repository/storage.rb +15 -20
  15. data/lib/vedeu/support/events.rb +58 -0
  16. data/lib/vedeu/support/exit.rb +2 -2
  17. data/lib/vedeu/support/{coordinate.rb → geometry.rb} +1 -1
  18. data/lib/vedeu/support/menu.rb +34 -6
  19. data/lib/vedeu/support/terminal.rb +1 -1
  20. data/lib/vedeu/support/translator.rb +2 -1
  21. data/lib/vedeu.rb +21 -7
  22. data/test/lib/vedeu/models/builders/builder_test.rb +11 -0
  23. data/test/lib/vedeu/models/interface_test.rb +3 -3
  24. data/test/lib/vedeu/parsing/text_adaptor_test.rb +24 -0
  25. data/test/lib/vedeu/repository/command_repository_test.rb +3 -11
  26. data/test/lib/vedeu/repository/interface_repository_test.rb +0 -23
  27. data/test/lib/vedeu/repository/repository_test.rb +45 -22
  28. data/test/lib/vedeu/repository/storage_test.rb +44 -19
  29. data/test/lib/vedeu/support/compositor_test.rb +2 -2
  30. data/test/lib/vedeu/support/events_test.rb +28 -0
  31. data/test/lib/vedeu/support/{coordinate_test.rb → geometry_test.rb} +110 -110
  32. data/test/lib/vedeu/support/menu_test.rb +69 -31
  33. data/vedeu.gemspec +1 -1
  34. metadata +11 -8
  35. data/lib/vedeu/repository/event_repository.rb +0 -35
  36. data/test/lib/vedeu/repository/event_repository_test.rb +0 -31
@@ -1,209 +1,209 @@
1
1
  require_relative '../../../test_helper'
2
- require_relative '../../../../lib/vedeu/support/coordinate'
2
+ require_relative '../../../../lib/vedeu/support/geometry'
3
3
 
4
4
  module Vedeu
5
- describe Coordinate do
5
+ describe Geometry do
6
6
  it 'raises an exception when the height attribute is not set' do
7
- proc { Coordinate.new({ width: 18 }) }.must_raise(KeyError)
7
+ proc { Geometry.new({ width: 18 }) }.must_raise(KeyError)
8
8
  end
9
9
 
10
10
  it 'raises an exception when the width attribute is not set' do
11
- proc { Coordinate.new({ height: 6 }) }.must_raise(KeyError)
11
+ proc { Geometry.new({ height: 6 }) }.must_raise(KeyError)
12
12
  end
13
13
 
14
14
  describe '#origin' do
15
15
  it 'returns the origin for the interface' do
16
- coordinate = Coordinate.new({ width: 5, height: 5, centred: false })
17
- coordinate.origin.must_equal("\e[1;1H")
16
+ geometry = Geometry.new({ width: 5, height: 5, centred: false })
17
+ geometry.origin.must_equal("\e[1;1H")
18
18
  end
19
19
 
20
20
  it 'returns the origin for the interface' do
21
21
  console = IO.console
22
22
  console.stub :winsize, [25, 80] do
23
- coordinate = Coordinate.new({ width: 5, height: 5 })
24
- coordinate.origin.must_equal("\e[10;38H")
23
+ geometry = Geometry.new({ width: 5, height: 5 })
24
+ geometry.origin.must_equal("\e[10;38H")
25
25
  end
26
26
  end
27
27
 
28
28
  it 'returns the line position relative to the origin' do
29
- coordinate = Coordinate.new({ width: 5, height: 5, centred: false })
30
- coordinate.origin(3).must_equal("\e[4;1H")
29
+ geometry = Geometry.new({ width: 5, height: 5, centred: false })
30
+ geometry.origin(3).must_equal("\e[4;1H")
31
31
  end
32
32
 
33
33
  it 'returns the origin for the interface when the interface' \
34
34
  ' is at a custom position' do
35
- coordinate = Coordinate.new({ width: 5, height: 5, x: 3, y: 6, centred: false })
36
- coordinate.origin.must_equal("\e[6;3H")
35
+ geometry = Geometry.new({ width: 5, height: 5, x: 3, y: 6, centred: false })
36
+ geometry.origin.must_equal("\e[6;3H")
37
37
  end
38
38
 
39
39
  it 'returns the line position relative to the origin when the' \
40
40
  ' interface is at a custom position' do
41
- coordinate = Coordinate.new({ width: 5, height: 5, x: 3, y: 6, centred: false })
42
- coordinate.origin(3).must_equal("\e[9;3H")
41
+ geometry = Geometry.new({ width: 5, height: 5, x: 3, y: 6, centred: false })
42
+ geometry.origin(3).must_equal("\e[9;3H")
43
43
  end
44
44
  end
45
45
 
46
46
  describe '#terminal_height' do
47
47
  it 'raises an exception if the value is less than 1' do
48
- coordinate = Coordinate.new({ height: 6, width: 18, terminal_height: -2 })
49
- proc { coordinate.terminal_height }.must_raise(OutOfBoundsError)
48
+ geometry = Geometry.new({ height: 6, width: 18, terminal_height: -2 })
49
+ proc { geometry.terminal_height }.must_raise(OutOfBoundsError)
50
50
  end
51
51
 
52
52
  it 'raises an exception if the value is greater than the terminal height' do
53
53
  console = IO.console
54
54
  console.stub :winsize, [25, 80] do
55
- coordinate = Coordinate.new({ height: 6, width: 18, terminal_height: 30 })
56
- proc { coordinate.terminal_height }.must_raise(OutOfBoundsError)
55
+ geometry = Geometry.new({ height: 6, width: 18, terminal_height: 30 })
56
+ proc { geometry.terminal_height }.must_raise(OutOfBoundsError)
57
57
  end
58
58
  end
59
59
 
60
60
  it 'returns the value of terminal_height' do
61
61
  console = IO.console
62
62
  console.stub :winsize, [25, 80] do
63
- coordinate = Coordinate.new({ height: 6, width: 18, terminal_height: 20 })
64
- coordinate.terminal_height.must_equal(20)
63
+ geometry = Geometry.new({ height: 6, width: 18, terminal_height: 20 })
64
+ geometry.terminal_height.must_equal(20)
65
65
  end
66
66
  end
67
67
 
68
68
  it 'returns the default height if not set' do
69
69
  console = IO.console
70
70
  console.stub :winsize, [25, 80] do
71
- coordinate = Coordinate.new({ height: 6, width: 18 })
72
- coordinate.terminal_height.must_equal(25)
71
+ geometry = Geometry.new({ height: 6, width: 18 })
72
+ geometry.terminal_height.must_equal(25)
73
73
  end
74
74
  end
75
75
  end
76
76
 
77
77
  describe '#height' do
78
78
  it 'raises an exception if the value is less than 1' do
79
- coordinate = Coordinate.new({ height: -6, width: 18 })
80
- proc { coordinate.height }.must_raise(OutOfBoundsError)
79
+ geometry = Geometry.new({ height: -6, width: 18 })
80
+ proc { geometry.height }.must_raise(OutOfBoundsError)
81
81
  end
82
82
 
83
83
  it 'raises an exception if the value is greater than the terminal height' do
84
84
  console = IO.console
85
85
  console.stub :winsize, [25, 80] do
86
- coordinate = Coordinate.new({ height: 30, width: 18 })
87
- proc { coordinate.height }.must_raise(OutOfBoundsError)
86
+ geometry = Geometry.new({ height: 30, width: 18 })
87
+ proc { geometry.height }.must_raise(OutOfBoundsError)
88
88
  end
89
89
  end
90
90
 
91
91
  it 'returns the value of height' do
92
- coordinate = Coordinate.new({ height: 6, width: 18 })
93
- coordinate.height.must_equal(6)
92
+ geometry = Geometry.new({ height: 6, width: 18 })
93
+ geometry.height.must_equal(6)
94
94
  end
95
95
  end
96
96
 
97
97
  describe '#y' do
98
98
  it 'raises an exception if the value is less than 1' do
99
- coordinate = Coordinate.new({ height: 6, width: 18, y: -2 })
100
- proc { coordinate.y }.must_raise(OutOfBoundsError)
99
+ geometry = Geometry.new({ height: 6, width: 18, y: -2 })
100
+ proc { geometry.y }.must_raise(OutOfBoundsError)
101
101
  end
102
102
 
103
103
  it 'raises an exception if the value is greater than the terminal height' do
104
104
  console = IO.console
105
105
  console.stub :winsize, [25, 80] do
106
- coordinate = Coordinate.new({ height: 6, width: 18, y: 30 })
107
- proc { coordinate.y }.must_raise(OutOfBoundsError)
106
+ geometry = Geometry.new({ height: 6, width: 18, y: 30 })
107
+ proc { geometry.y }.must_raise(OutOfBoundsError)
108
108
  end
109
109
  end
110
110
 
111
111
  it 'returns the value of y' do
112
- coordinate = Coordinate.new({ height: 6, width: 18, y: 6 })
113
- coordinate.y.must_equal(6)
112
+ geometry = Geometry.new({ height: 6, width: 18, y: 6 })
113
+ geometry.y.must_equal(6)
114
114
  end
115
115
 
116
116
  it 'returns 1 if not set' do
117
- coordinate = Coordinate.new({ height: 6, width: 18 })
118
- coordinate.y.must_equal(1)
117
+ geometry = Geometry.new({ height: 6, width: 18 })
118
+ geometry.y.must_equal(1)
119
119
  end
120
120
  end
121
121
 
122
122
  describe '#terminal_width' do
123
123
  it 'raises an exception if the value is less than 1' do
124
- coordinate = Coordinate.new({ height: 6, width: 18, terminal_width: -2 })
125
- proc { coordinate.terminal_width }.must_raise(OutOfBoundsError)
124
+ geometry = Geometry.new({ height: 6, width: 18, terminal_width: -2 })
125
+ proc { geometry.terminal_width }.must_raise(OutOfBoundsError)
126
126
  end
127
127
 
128
128
  it 'raises an exception if the value is greater than the terminal width' do
129
129
  console = IO.console
130
130
  console.stub :winsize, [25, 80] do
131
- coordinate = Coordinate.new({ height: 6, width: 18, terminal_width: 85 })
132
- proc { coordinate.terminal_width }.must_raise(OutOfBoundsError)
131
+ geometry = Geometry.new({ height: 6, width: 18, terminal_width: 85 })
132
+ proc { geometry.terminal_width }.must_raise(OutOfBoundsError)
133
133
  end
134
134
  end
135
135
 
136
136
  it 'returns the value of terminal_width' do
137
137
  console = IO.console
138
138
  console.stub :winsize, [25, 80] do
139
- coordinate = Coordinate.new({ height: 6, width: 18, terminal_width: 40 })
140
- coordinate.terminal_width.must_equal(40)
139
+ geometry = Geometry.new({ height: 6, width: 18, terminal_width: 40 })
140
+ geometry.terminal_width.must_equal(40)
141
141
  end
142
142
  end
143
143
 
144
144
  it 'returns the default width if not set' do
145
145
  console = IO.console
146
146
  console.stub :winsize, [25, 80] do
147
- coordinate = Coordinate.new({ height: 6, width: 18 })
148
- coordinate.terminal_width.must_equal(80)
147
+ geometry = Geometry.new({ height: 6, width: 18 })
148
+ geometry.terminal_width.must_equal(80)
149
149
  end
150
150
  end
151
151
  end
152
152
 
153
153
  describe '#width' do
154
154
  it 'raises an exception if the value is less than 1' do
155
- coordinate = Coordinate.new({ height: 6, width: -18 })
156
- proc { coordinate.width }.must_raise(OutOfBoundsError)
155
+ geometry = Geometry.new({ height: 6, width: -18 })
156
+ proc { geometry.width }.must_raise(OutOfBoundsError)
157
157
  end
158
158
 
159
159
  it 'raises an exception if the value is greater than the terminal width' do
160
160
  console = IO.console
161
161
  console.stub :winsize, [25, 80] do
162
- coordinate = Coordinate.new({ height: 6, width: 85 })
163
- proc { coordinate.width }.must_raise(OutOfBoundsError)
162
+ geometry = Geometry.new({ height: 6, width: 85 })
163
+ proc { geometry.width }.must_raise(OutOfBoundsError)
164
164
  end
165
165
  end
166
166
 
167
167
  it 'returns the value of width' do
168
- coordinate = Coordinate.new({ height: 6, width: 18, x: 6 })
169
- coordinate.width.must_equal(18)
168
+ geometry = Geometry.new({ height: 6, width: 18, x: 6 })
169
+ geometry.width.must_equal(18)
170
170
  end
171
171
  end
172
172
 
173
173
  describe '#x' do
174
174
  it 'raises an exception if the value is less than 1' do
175
- coordinate = Coordinate.new({ height: 6, width: 18, x: -2 })
176
- proc { coordinate.x }.must_raise(OutOfBoundsError)
175
+ geometry = Geometry.new({ height: 6, width: 18, x: -2 })
176
+ proc { geometry.x }.must_raise(OutOfBoundsError)
177
177
  end
178
178
 
179
179
  it 'raises an exception if the value is greater than the terminal width' do
180
180
  console = IO.console
181
181
  console.stub :winsize, [25, 80] do
182
- coordinate = Coordinate.new({ height: 6, width: 18, x: 85 })
183
- proc { coordinate.x }.must_raise(OutOfBoundsError)
182
+ geometry = Geometry.new({ height: 6, width: 18, x: 85 })
183
+ proc { geometry.x }.must_raise(OutOfBoundsError)
184
184
  end
185
185
  end
186
186
 
187
187
  it 'returns the value of x' do
188
- coordinate = Coordinate.new({ height: 6, width: 18, x: 6 })
189
- coordinate.x.must_equal(6)
188
+ geometry = Geometry.new({ height: 6, width: 18, x: 6 })
189
+ geometry.x.must_equal(6)
190
190
  end
191
191
 
192
192
  it 'returns 1 if not set' do
193
- coordinate = Coordinate.new({ height: 6, width: 18 })
194
- coordinate.x.must_equal(1)
193
+ geometry = Geometry.new({ height: 6, width: 18 })
194
+ geometry.x.must_equal(1)
195
195
  end
196
196
  end
197
197
 
198
198
  describe '#centered' do
199
199
  it 'has a centred attribute' do
200
- coordinate = Coordinate.new({ height: 6, width: 18, centred: false })
201
- coordinate.centred.must_equal(false)
200
+ geometry = Geometry.new({ height: 6, width: 18, centred: false })
201
+ geometry.centred.must_equal(false)
202
202
  end
203
203
 
204
204
  it 'sets the centred attribute to true if not set' do
205
- coordinate = Coordinate.new({ height: 6, width: 18 })
206
- coordinate.centred.must_equal(true)
205
+ geometry = Geometry.new({ height: 6, width: 18 })
206
+ geometry.centred.must_equal(true)
207
207
  end
208
208
  end
209
209
 
@@ -211,22 +211,22 @@ module Vedeu
211
211
  it 'returns a tuple containing the default centre coordinates' do
212
212
  console = IO.console
213
213
  console.stub :winsize, [25, 80] do
214
- coordinate = Coordinate.new({ height: 6, width: 18 })
215
- coordinate.centre.must_equal([12, 40])
214
+ geometry = Geometry.new({ height: 6, width: 18 })
215
+ geometry.centre.must_equal([12, 40])
216
216
  end
217
217
  end
218
218
 
219
219
  it 'returns a tuple containing the centre coordinates' do
220
- coordinate = Coordinate.new({ height: 6, width: 18, terminal_height: 12, terminal_width: 40 })
221
- coordinate.centre.must_equal([6, 20])
220
+ geometry = Geometry.new({ height: 6, width: 18, terminal_height: 12, terminal_width: 40 })
221
+ geometry.centre.must_equal([6, 20])
222
222
  end
223
223
 
224
224
  it 'returns a tuple containing the centre coordinates when an' \
225
225
  ' alternative terminal height is set' do
226
226
  console = IO.console
227
227
  console.stub :winsize, [25, 80] do
228
- coordinate = Coordinate.new({ height: 6, width: 18, terminal_height: 12 })
229
- coordinate.centre.must_equal([6, 40])
228
+ geometry = Geometry.new({ height: 6, width: 18, terminal_height: 12 })
229
+ geometry.centre.must_equal([6, 40])
230
230
  end
231
231
  end
232
232
 
@@ -234,109 +234,109 @@ module Vedeu
234
234
  ' alternative terminal width is set' do
235
235
  console = IO.console
236
236
  console.stub :winsize, [25, 80] do
237
- coordinate = Coordinate.new({ height: 6, width: 18, terminal_width: 40 })
238
- coordinate.centre.must_equal([12, 20])
237
+ geometry = Geometry.new({ height: 6, width: 18, terminal_width: 40 })
238
+ geometry.centre.must_equal([12, 20])
239
239
  end
240
240
  end
241
241
  end
242
242
 
243
243
  describe '#top' do
244
244
  it 'centred is true and terminal height is set' do
245
- coordinate = Coordinate.new({ height: 6, width: 18, terminal_height: 12 })
246
- coordinate.top.must_equal(3)
245
+ geometry = Geometry.new({ height: 6, width: 18, terminal_height: 12 })
246
+ geometry.top.must_equal(3)
247
247
  end
248
248
 
249
249
  it 'centred is true and with default terminal height' do
250
250
  console = IO.console
251
251
  console.stub :winsize, [25, 80] do
252
- coordinate = Coordinate.new({ height: 6, width: 18 })
253
- coordinate.top.must_equal(9)
252
+ geometry = Geometry.new({ height: 6, width: 18 })
253
+ geometry.top.must_equal(9)
254
254
  end
255
255
  end
256
256
 
257
257
  it 'centred is false' do
258
- coordinate = Coordinate.new({ height: 6, width: 18, centred: false })
259
- coordinate.top.must_equal(1)
258
+ geometry = Geometry.new({ height: 6, width: 18, centred: false })
259
+ geometry.top.must_equal(1)
260
260
  end
261
261
 
262
262
  it 'centred is false and y is set' do
263
- coordinate = Coordinate.new({ height: 6, width: 18, y: 4, centred: false })
264
- coordinate.top.must_equal(4)
263
+ geometry = Geometry.new({ height: 6, width: 18, y: 4, centred: false })
264
+ geometry.top.must_equal(4)
265
265
  end
266
266
  end
267
267
 
268
268
  describe '#left' do
269
269
  it 'centred is true and terminal width is set' do
270
- coordinate = Coordinate.new({ height: 6, width: 18, terminal_width: 40 })
271
- coordinate.left.must_equal(11)
270
+ geometry = Geometry.new({ height: 6, width: 18, terminal_width: 40 })
271
+ geometry.left.must_equal(11)
272
272
  end
273
273
 
274
274
  it 'centred is true and with default terminal width' do
275
275
  console = IO.console
276
276
  console.stub :winsize, [25, 80] do
277
- coordinate = Coordinate.new({ height: 6, width: 18 })
278
- coordinate.left.must_equal(31)
277
+ geometry = Geometry.new({ height: 6, width: 18 })
278
+ geometry.left.must_equal(31)
279
279
  end
280
280
  end
281
281
 
282
282
  it 'centred is false' do
283
- coordinate = Coordinate.new({ height: 6, width: 18, centred: false })
284
- coordinate.left.must_equal(1)
283
+ geometry = Geometry.new({ height: 6, width: 18, centred: false })
284
+ geometry.left.must_equal(1)
285
285
  end
286
286
 
287
287
  it 'centred is false and x is set' do
288
- coordinate = Coordinate.new({ height: 6, width: 18, x: 5, centred: false })
289
- coordinate.left.must_equal(5)
288
+ geometry = Geometry.new({ height: 6, width: 18, x: 5, centred: false })
289
+ geometry.left.must_equal(5)
290
290
  end
291
291
  end
292
292
 
293
293
  describe '#bottom' do
294
294
  it 'centred is true and terminal height is set' do
295
- coordinate = Coordinate.new({ height: 6, width: 18, terminal_height: 12 })
296
- coordinate.bottom.must_equal(9)
295
+ geometry = Geometry.new({ height: 6, width: 18, terminal_height: 12 })
296
+ geometry.bottom.must_equal(9)
297
297
  end
298
298
 
299
299
  it 'centred is true and with default terminal height' do
300
300
  console = IO.console
301
301
  console.stub :winsize, [25, 80] do
302
- coordinate = Coordinate.new({ height: 6, width: 18 })
303
- coordinate.bottom.must_equal(15)
302
+ geometry = Geometry.new({ height: 6, width: 18 })
303
+ geometry.bottom.must_equal(15)
304
304
  end
305
305
  end
306
306
 
307
307
  it 'centred is false' do
308
- coordinate = Coordinate.new({ height: 6, width: 18, centred: false })
309
- coordinate.bottom.must_equal(7)
308
+ geometry = Geometry.new({ height: 6, width: 18, centred: false })
309
+ geometry.bottom.must_equal(7)
310
310
  end
311
311
 
312
312
  it 'centred is false and y is set' do
313
- coordinate = Coordinate.new({ height: 6, width: 18, y: 5, centred: false })
314
- coordinate.bottom.must_equal(11)
313
+ geometry = Geometry.new({ height: 6, width: 18, y: 5, centred: false })
314
+ geometry.bottom.must_equal(11)
315
315
  end
316
316
  end
317
317
 
318
318
  describe '#right' do
319
319
  it 'centred is true and terminal width is set' do
320
- coordinate = Coordinate.new({ height: 6, width: 18, terminal_width: 40 })
321
- coordinate.right.must_equal(29)
320
+ geometry = Geometry.new({ height: 6, width: 18, terminal_width: 40 })
321
+ geometry.right.must_equal(29)
322
322
  end
323
323
 
324
324
  it 'centred is true and with default terminal width' do
325
325
  console = IO.console
326
326
  console.stub :winsize, [25, 80] do
327
- coordinate = Coordinate.new({ height: 6, width: 18 })
328
- coordinate.right.must_equal(49)
327
+ geometry = Geometry.new({ height: 6, width: 18 })
328
+ geometry.right.must_equal(49)
329
329
  end
330
330
  end
331
331
 
332
332
  it 'centred is false' do
333
- coordinate = Coordinate.new({ height: 6, width: 18, centred: false })
334
- coordinate.right.must_equal(19)
333
+ geometry = Geometry.new({ height: 6, width: 18, centred: false })
334
+ geometry.right.must_equal(19)
335
335
  end
336
336
 
337
337
  it 'centred is false and x is set' do
338
- coordinate = Coordinate.new({ height: 6, width: 18, x: 5, centred: false })
339
- coordinate.right.must_equal(23)
338
+ geometry = Geometry.new({ height: 6, width: 18, x: 5, centred: false })
339
+ geometry.right.must_equal(23)
340
340
  end
341
341
  end
342
342
 
@@ -344,8 +344,8 @@ module Vedeu
344
344
  it 'centred is true' do
345
345
  console = IO.console
346
346
  console.stub :winsize, [25, 80] do
347
- coordinate = Coordinate.new({ height: 6, width: 18 })
348
- coordinate.position.must_equal({
347
+ geometry = Geometry.new({ height: 6, width: 18 })
348
+ geometry.position.must_equal({
349
349
  y: 9,
350
350
  x: 31,
351
351
  height: 6,
@@ -360,8 +360,8 @@ module Vedeu
360
360
  end
361
361
 
362
362
  it 'centred is false and x is set' do
363
- coordinate = Coordinate.new({ height: 6, width: 18, x: 7, centred: false })
364
- coordinate.position.must_equal({
363
+ geometry = Geometry.new({ height: 6, width: 18, x: 7, centred: false })
364
+ geometry.position.must_equal({
365
365
  y: 1,
366
366
  x: 7,
367
367
  height: 6,
@@ -375,8 +375,8 @@ module Vedeu
375
375
  end
376
376
 
377
377
  it 'centred is false and y is set' do
378
- coordinate = Coordinate.new({ height: 6, width: 18, y: 5, centred: false })
379
- coordinate.position.must_equal({
378
+ geometry = Geometry.new({ height: 6, width: 18, y: 5, centred: false })
379
+ geometry.position.must_equal({
380
380
  y: 5,
381
381
  x: 1,
382
382
  height: 6,
@@ -390,8 +390,8 @@ module Vedeu
390
390
  end
391
391
 
392
392
  it 'centred is false' do
393
- coordinate = Coordinate.new({ height: 6, width: 18, centred: false })
394
- coordinate.position.must_equal({
393
+ geometry = Geometry.new({ height: 6, width: 18, centred: false })
394
+ geometry.position.must_equal({
395
395
  y: 1,
396
396
  x: 1,
397
397
  height: 6,