vedeu 0.6.4 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +40 -0
  3. data/README.md +1 -0
  4. data/docs/dsl.md +24 -24
  5. data/lib/vedeu/all.rb +21 -44
  6. data/lib/vedeu/api.rb +13 -13
  7. data/lib/vedeu/application/application_controller.rb +2 -0
  8. data/lib/vedeu/bindings/movement.rb +53 -18
  9. data/lib/vedeu/bindings/refresh.rb +1 -1
  10. data/lib/vedeu/bindings/system.rb +2 -2
  11. data/lib/vedeu/bindings/visibility.rb +3 -3
  12. data/lib/vedeu/borders/all.rb +13 -0
  13. data/lib/vedeu/borders/border.rb +209 -202
  14. data/lib/vedeu/{dsl/border.rb → borders/dsl.rb} +15 -15
  15. data/lib/vedeu/{null/border.rb → borders/null.rb} +9 -9
  16. data/lib/vedeu/borders/render.rb +347 -0
  17. data/lib/vedeu/borders/repository.rb +19 -0
  18. data/lib/vedeu/buffers/all.rb +13 -0
  19. data/lib/vedeu/buffers/buffer.rb +182 -176
  20. data/lib/vedeu/{null/buffer.rb → buffers/null.rb} +8 -8
  21. data/lib/vedeu/buffers/repository.rb +24 -0
  22. data/lib/vedeu/buffers/virtual_buffer.rb +2 -2
  23. data/lib/vedeu/cursors/all.rb +11 -0
  24. data/lib/vedeu/cursors/cursor.rb +276 -0
  25. data/lib/vedeu/cursors/refresh.rb +84 -0
  26. data/lib/vedeu/cursors/repository.rb +34 -0
  27. data/lib/vedeu/dsl/interface.rb +9 -9
  28. data/lib/vedeu/dsl/shared.rb +11 -11
  29. data/lib/vedeu/{exceptions.rb → error.rb} +2 -2
  30. data/lib/vedeu/esc/esc.rb +1 -1
  31. data/lib/vedeu/geometry/all.rb +18 -0
  32. data/lib/vedeu/geometry/area.rb +170 -160
  33. data/lib/vedeu/geometry/coordinate.rb +61 -39
  34. data/lib/vedeu/geometry/dimension.rb +139 -132
  35. data/lib/vedeu/{dsl/geometry.rb → geometry/dsl.rb} +11 -11
  36. data/lib/vedeu/geometry/generic_coordinate.rb +159 -153
  37. data/lib/vedeu/geometry/geometry.rb +310 -212
  38. data/lib/vedeu/geometry/grid.rb +73 -69
  39. data/lib/vedeu/{null/geometry.rb → geometry/null.rb} +10 -10
  40. data/lib/vedeu/geometry/position.rb +124 -120
  41. data/lib/vedeu/geometry/repository.rb +19 -0
  42. data/lib/vedeu/input/editor/document.rb +2 -2
  43. data/lib/vedeu/internal_api.rb +8 -8
  44. data/lib/vedeu/models/escape.rb +2 -2
  45. data/lib/vedeu/models/interface.rb +1 -1
  46. data/lib/vedeu/models/page.rb +89 -0
  47. data/lib/vedeu/models/row.rb +66 -0
  48. data/lib/vedeu/models/toggleable.rb +1 -1
  49. data/lib/vedeu/models/views/char.rb +7 -6
  50. data/lib/vedeu/models/views/line.rb +1 -1
  51. data/lib/vedeu/models/views/view.rb +2 -2
  52. data/lib/vedeu/options.rb +19 -0
  53. data/lib/vedeu/output/clear/named_interface.rb +1 -1
  54. data/lib/vedeu/output/direct.rb +1 -1
  55. data/lib/vedeu/output/presentation.rb +2 -1
  56. data/lib/vedeu/output/viewport.rb +3 -3
  57. data/lib/vedeu/repositories/model.rb +9 -1
  58. data/lib/vedeu/repositories/repository.rb +5 -0
  59. data/lib/vedeu/terminal/terminal.rb +3 -3
  60. data/lib/vedeu/version.rb +1 -1
  61. data/test/lib/vedeu/borders/border_test.rb +299 -291
  62. data/test/lib/vedeu/{dsl/border_test.rb → borders/dsl_test.rb} +6 -6
  63. data/test/lib/vedeu/{null/border_test.rb → borders/null_test.rb} +6 -6
  64. data/test/lib/vedeu/borders/render_test.rb +125 -0
  65. data/test/lib/vedeu/borders/repository_test.rb +17 -0
  66. data/test/lib/vedeu/buffers/buffer_test.rb +116 -112
  67. data/test/lib/vedeu/{null/buffer_test.rb → buffers/null_test.rb} +5 -5
  68. data/test/lib/vedeu/buffers/repository_test.rb +18 -0
  69. data/test/lib/vedeu/cursors/cursor_test.rb +370 -0
  70. data/test/lib/vedeu/cursors/refresh_test.rb +69 -0
  71. data/test/lib/vedeu/cursors/repository_test.rb +41 -0
  72. data/test/lib/vedeu/dsl/interface_test.rb +5 -5
  73. data/test/lib/vedeu/{exceptions_test.rb → error_test.rb} +0 -0
  74. data/test/lib/vedeu/geometry/area_test.rb +141 -137
  75. data/test/lib/vedeu/geometry/coordinate_test.rb +93 -89
  76. data/test/lib/vedeu/geometry/dimension_test.rb +137 -133
  77. data/test/lib/vedeu/{dsl/geometry_test.rb → geometry/dsl_test.rb} +17 -17
  78. data/test/lib/vedeu/geometry/generic_coordinate_test.rb +32 -28
  79. data/test/lib/vedeu/geometry/geometry_test.rb +282 -157
  80. data/test/lib/vedeu/geometry/grid_test.rb +35 -31
  81. data/test/lib/vedeu/{null/geometry_test.rb → geometry/null_test.rb} +5 -5
  82. data/test/lib/vedeu/geometry/position_test.rb +146 -142
  83. data/test/lib/vedeu/geometry/repository_test.rb +19 -0
  84. data/test/lib/vedeu/input/editor/document_test.rb +1 -1
  85. data/test/lib/vedeu/models/escape_test.rb +1 -1
  86. data/test/lib/vedeu/models/interface_test.rb +2 -2
  87. data/test/lib/vedeu/models/page_test.rb +235 -0
  88. data/test/lib/vedeu/models/row_test.rb +111 -0
  89. data/test/lib/vedeu/models/views/char_test.rb +3 -3
  90. data/test/lib/vedeu/options_test.rb +57 -0
  91. data/test/lib/vedeu/output/clear/named_interface_test.rb +1 -1
  92. data/test/lib/vedeu/output/renderers/json_test.rb +1 -1
  93. data/test/lib/vedeu/output/viewport_test.rb +15 -9
  94. data/test/lib/vedeu/refresh/refresh_buffer_test.rb +12 -12
  95. data/test/lib/vedeu/repositories/repositories_test.rb +1 -1
  96. data/test/lib/vedeu/repositories/repository_test.rb +7 -0
  97. data/test/lib/vedeu/terminal/terminal_test.rb +1 -1
  98. data/test/test_helper.rb +1 -1
  99. data/vedeu.gemspec +2 -2
  100. metadata +57 -63
  101. data/lib/vedeu/borders/borders.rb +0 -15
  102. data/lib/vedeu/borders/render_border.rb +0 -331
  103. data/lib/vedeu/buffers/buffers.rb +0 -20
  104. data/lib/vedeu/cursor/cursor.rb +0 -174
  105. data/lib/vedeu/cursor/cursors.rb +0 -30
  106. data/lib/vedeu/cursor/move.rb +0 -239
  107. data/lib/vedeu/cursor/reposition.rb +0 -78
  108. data/lib/vedeu/geometry/geometries.rb +0 -15
  109. data/lib/vedeu/refresh/refresh_cursor.rb +0 -92
  110. data/test/lib/vedeu/borders/borders_test.rb +0 -13
  111. data/test/lib/vedeu/borders/render_border_test.rb +0 -121
  112. data/test/lib/vedeu/buffers/buffers_test.rb +0 -14
  113. data/test/lib/vedeu/cursor/cursor_test.rb +0 -246
  114. data/test/lib/vedeu/cursor/cursors_test.rb +0 -37
  115. data/test/lib/vedeu/cursor/move_test.rb +0 -301
  116. data/test/lib/vedeu/cursor/reposition_test.rb +0 -63
  117. data/test/lib/vedeu/geometry/geometries_test.rb +0 -15
  118. data/test/lib/vedeu/refresh/refresh_cursor_test.rb +0 -65
@@ -2,51 +2,55 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
- describe Grid do
5
+ module Geometry
6
6
 
7
- let(:described) { Vedeu::Grid }
8
- let(:instance) { described.new(_value) }
9
- let(:_value) { 2 }
7
+ describe Grid do
10
8
 
11
- before { IO.console.stubs(:winsize).returns([25, 80]) }
9
+ let(:described) { Vedeu::Geometry::Grid }
10
+ let(:instance) { described.new(_value) }
11
+ let(:_value) { 2 }
12
12
 
13
- describe '#initialize' do
14
- it { instance.must_be_instance_of(described) }
15
- it { instance.instance_variable_get('@value').must_equal(_value) }
16
- end
13
+ before { IO.console.stubs(:winsize).returns([25, 80]) }
17
14
 
18
- describe '.columns' do
19
- context 'when the value is less than 1' do
20
- it { proc { Grid.columns(0) }.must_raise(Vedeu::Error::OutOfRange) }
15
+ describe '#initialize' do
16
+ it { instance.must_be_instance_of(described) }
17
+ it { instance.instance_variable_get('@value').must_equal(_value) }
21
18
  end
22
19
 
23
- context 'when the value is greater than 12' do
24
- it { proc { Grid.columns(13) }.must_raise(Vedeu::Error::OutOfRange) }
25
- end
20
+ describe '.columns' do
21
+ context 'when the value is less than 1' do
22
+ it { proc { Vedeu::Geometry::Grid.columns(0) }.must_raise(Vedeu::Error::OutOfRange) }
23
+ end
26
24
 
27
- context 'when the value is in range' do
28
- it 'returns the value of the column' do
29
- Grid.columns(7).must_equal(42)
25
+ context 'when the value is greater than 12' do
26
+ it { proc { Vedeu::Geometry::Grid.columns(13) }.must_raise(Vedeu::Error::OutOfRange) }
30
27
  end
31
- end
32
- end
33
28
 
34
- describe '.rows' do
35
- context 'when the value is less than 1' do
36
- it { proc { Grid.rows(0) }.must_raise(Vedeu::Error::OutOfRange) }
29
+ context 'when the value is in range' do
30
+ it 'returns the value of the column' do
31
+ Vedeu::Geometry::Grid.columns(7).must_equal(42)
32
+ end
33
+ end
37
34
  end
38
35
 
39
- context 'when the value is greater than 12' do
40
- it { proc { Grid.rows(13) }.must_raise(Vedeu::Error::OutOfRange) }
41
- end
36
+ describe '.rows' do
37
+ context 'when the value is less than 1' do
38
+ it { proc { Vedeu::Geometry::Grid.rows(0) }.must_raise(Vedeu::Error::OutOfRange) }
39
+ end
40
+
41
+ context 'when the value is greater than 12' do
42
+ it { proc { Vedeu::Geometry::Grid.rows(13) }.must_raise(Vedeu::Error::OutOfRange) }
43
+ end
42
44
 
43
- context 'when the value is in range' do
44
- it 'returns the value of the row' do
45
- Grid.rows(7).must_equal(14)
45
+ context 'when the value is in range' do
46
+ it 'returns the value of the row' do
47
+ Vedeu::Geometry::Grid.rows(7).must_equal(14)
48
+ end
46
49
  end
47
50
  end
48
- end
49
51
 
50
- end # Grid
52
+ end # Grid
53
+
54
+ end # Geometry
51
55
 
52
56
  end # Vedeu
@@ -2,11 +2,11 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
- module Null
5
+ module Geometry
6
6
 
7
- describe Geometry do
7
+ describe Null do
8
8
 
9
- let(:described) { Vedeu::Null::Geometry }
9
+ let(:described) { Vedeu::Geometry::Null }
10
10
  let(:instance) { described.new(attributes) }
11
11
  let(:attributes){
12
12
  {
@@ -95,8 +95,8 @@ module Vedeu
95
95
  it { instance.yn.must_equal(25) }
96
96
  end
97
97
 
98
- end # Geometry
98
+ end # Null
99
99
 
100
- end # Null
100
+ end # Geometry
101
101
 
102
102
  end # Vedeu
@@ -2,217 +2,221 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
- describe Position do
5
+ module Geometry
6
6
 
7
- let(:described) { Vedeu::Position }
8
- let(:instance) { described.new(y, x) }
9
- let(:y) { 12 }
10
- let(:x) { 19 }
7
+ describe Position do
11
8
 
12
- describe 'accessors' do
13
- it { instance.must_respond_to(:y) }
14
- it { instance.must_respond_to(:first) }
15
- it { instance.must_respond_to(:x) }
16
- it { instance.must_respond_to(:last) }
17
- end
9
+ let(:described) { Vedeu::Geometry::Position }
10
+ let(:instance) { described.new(y, x) }
11
+ let(:y) { 12 }
12
+ let(:x) { 19 }
18
13
 
19
- describe '#initialize' do
20
- it { instance.must_be_instance_of(described) }
21
- it { instance.instance_variable_get('@y').must_equal(y) }
22
- it { instance.instance_variable_get('@x').must_equal(x) }
23
- end
14
+ describe 'accessors' do
15
+ it { instance.must_respond_to(:y) }
16
+ it { instance.must_respond_to(:first) }
17
+ it { instance.must_respond_to(:x) }
18
+ it { instance.must_respond_to(:last) }
19
+ end
24
20
 
25
- describe '.[]' do
26
- subject { described.[](y, x) }
21
+ describe '#initialize' do
22
+ it { instance.must_be_instance_of(described) }
23
+ it { instance.instance_variable_get('@y').must_equal(y) }
24
+ it { instance.instance_variable_get('@x').must_equal(x) }
25
+ end
27
26
 
28
- it { instance.must_be_instance_of(described) }
29
- end
27
+ describe '.[]' do
28
+ subject { described.[](y, x) }
30
29
 
31
- describe '#<=>' do
32
- subject { instance.<=>(other) }
30
+ it { instance.must_be_instance_of(described) }
31
+ end
33
32
 
34
- context 'when y is the same as other.y' do
35
- context 'when x is the same as other.x' do
36
- let(:other) { described.new(12, 19) }
33
+ describe '#<=>' do
34
+ subject { instance.<=>(other) }
37
35
 
38
- it { subject.must_equal(0) }
39
- end
36
+ context 'when y is the same as other.y' do
37
+ context 'when x is the same as other.x' do
38
+ let(:other) { described.new(12, 19) }
40
39
 
41
- context 'when x is different to other.x' do
42
- let(:other) { described.new(12, 21) }
40
+ it { subject.must_equal(0) }
41
+ end
43
42
 
44
- it { subject.must_equal(-1) }
43
+ context 'when x is different to other.x' do
44
+ let(:other) { described.new(12, 21) }
45
+
46
+ it { subject.must_equal(-1) }
47
+ end
45
48
  end
46
- end
47
49
 
48
- context 'when y is different to other.y' do
49
- let(:other) { described.new(14, 19) }
50
+ context 'when y is different to other.y' do
51
+ let(:other) { described.new(14, 19) }
50
52
 
51
- it { subject.must_equal(-1) }
53
+ it { subject.must_equal(-1) }
54
+ end
52
55
  end
53
- end
54
56
 
55
- describe '.coerce' do
56
- let(:_value) {}
57
+ describe '.coerce' do
58
+ let(:_value) {}
57
59
 
58
- subject { described.coerce(_value) }
60
+ subject { described.coerce(_value) }
59
61
 
60
- context 'when the value is already a Position' do
61
- let(:_value) { instance }
62
+ context 'when the value is already a Position' do
63
+ let(:_value) { instance }
62
64
 
63
- it { subject.must_equal(instance) }
64
- end
65
+ it { subject.must_equal(instance) }
66
+ end
65
67
 
66
- context 'when the value is an Array' do
67
- let(:_value) { [2, 8] }
68
+ context 'when the value is an Array' do
69
+ let(:_value) { [2, 8] }
68
70
 
69
- it { subject.must_be_instance_of(described) }
70
- it { subject.y.must_equal(2) }
71
- it { subject.x.must_equal(8) }
72
- end
71
+ it { subject.must_be_instance_of(described) }
72
+ it { subject.y.must_equal(2) }
73
+ it { subject.x.must_equal(8) }
74
+ end
73
75
 
74
- context 'when the value is a Hash' do
75
- let(:_value) { { y: 3, x: 9 } }
76
+ context 'when the value is a Hash' do
77
+ let(:_value) { { y: 3, x: 9 } }
76
78
 
77
- it { subject.must_be_instance_of(described) }
78
- it { subject.y.must_equal(3) }
79
- it { subject.x.must_equal(9) }
80
- end
79
+ it { subject.must_be_instance_of(described) }
80
+ it { subject.y.must_equal(3) }
81
+ it { subject.x.must_equal(9) }
82
+ end
81
83
 
82
- context 'when the value is something unhandled' do
83
- it { subject.must_be_instance_of(NilClass) }
84
+ context 'when the value is something unhandled' do
85
+ it { subject.must_be_instance_of(NilClass) }
86
+ end
84
87
  end
85
- end
86
88
 
87
- describe '#eql?' do
88
- let(:other) { described.new(12, 19) }
89
+ describe '#eql?' do
90
+ let(:other) { described.new(12, 19) }
89
91
 
90
- subject { instance.eql?(other) }
92
+ subject { instance.eql?(other) }
91
93
 
92
- it { subject.must_equal(true) }
94
+ it { subject.must_equal(true) }
93
95
 
94
- context 'when different to other' do
95
- let(:other) { described.new(2, 9) }
96
+ context 'when different to other' do
97
+ let(:other) { described.new(2, 9) }
96
98
 
97
- it { subject.must_equal(false) }
99
+ it { subject.must_equal(false) }
100
+ end
98
101
  end
99
- end
100
102
 
101
- describe '#to_a' do
102
- subject { Position.new.to_a }
103
+ describe '#to_a' do
104
+ subject { Vedeu::Geometry::Position.new.to_a }
103
105
 
104
- it { subject.must_equal([1, 1]) }
105
- end
106
+ it { subject.must_equal([1, 1]) }
107
+ end
106
108
 
107
- describe '#to_position' do
108
- subject { instance.to_position }
109
+ describe '#to_position' do
110
+ subject { instance.to_position }
109
111
 
110
- it { subject.must_be_instance_of(Vedeu::Position) }
111
- it { subject.must_equal(instance) }
112
- end
112
+ it { subject.must_be_instance_of(Vedeu::Geometry::Position) }
113
+ it { subject.must_equal(instance) }
114
+ end
113
115
 
114
- describe '#to_s' do
115
- # subject { described.new.to_s }
116
+ describe '#to_s' do
117
+ # subject { described.new.to_s }
116
118
 
117
- it 'returns an escape sequence when no coordinates are provided' do
118
- Position.new.to_s.must_equal("\e[1;1H")
119
- end
119
+ it 'returns an escape sequence when no coordinates are provided' do
120
+ Vedeu::Geometry::Position.new.to_s.must_equal("\e[1;1H")
121
+ end
120
122
 
121
- it 'returns an escape sequence when coordinates are provided' do
122
- Position[12, 19].to_s.must_equal("\e[12;19H")
123
- end
123
+ it 'returns an escape sequence when coordinates are provided' do
124
+ Vedeu::Geometry::Position[12, 19].to_s.must_equal("\e[12;19H")
125
+ end
124
126
 
125
- it 'returns an escape sequence if a coordinate is missing' do
126
- Position.new(12).to_s.must_equal("\e[12;1H")
127
- end
127
+ it 'returns an escape sequence if a coordinate is missing' do
128
+ Vedeu::Geometry::Position.new(12).to_s.must_equal("\e[12;1H")
129
+ end
128
130
 
129
- it 'returns an escape sequence if the x coordinate is negative' do
130
- Position[12, -5].to_s.must_equal("\e[12;1H")
131
- end
131
+ it 'returns an escape sequence if the x coordinate is negative' do
132
+ Vedeu::Geometry::Position[12, -5].to_s.must_equal("\e[12;1H")
133
+ end
132
134
 
133
- it 'returns an escape sequence if the y coordinate is negative' do
134
- Position[-12, 5].to_s.must_equal("\e[1;5H")
135
- end
135
+ it 'returns an escape sequence if the y coordinate is negative' do
136
+ Vedeu::Geometry::Position[-12, 5].to_s.must_equal("\e[1;5H")
137
+ end
136
138
 
137
- it 'resets to starting position when a block is given' do
138
- Position[4, 9].to_s { 'test' }.must_equal("\e[4;9Htest")
139
+ it 'resets to starting position when a block is given' do
140
+ Vedeu::Geometry::Position[4, 9].to_s { 'test' }.must_equal("\e[4;9Htest")
141
+ end
139
142
  end
140
- end
141
143
 
142
- describe '#as_indices' do
143
- subject { instance.as_indices }
144
+ describe '#as_indices' do
145
+ subject { instance.as_indices }
144
146
 
145
- it { subject.must_equal([11, 18]) }
147
+ it { subject.must_equal([11, 18]) }
146
148
 
147
- context 'when y is less than 1' do
148
- let(:y) { -3 }
149
+ context 'when y is less than 1' do
150
+ let(:y) { -3 }
149
151
 
150
- it { subject.must_equal([0, 18]) }
151
- end
152
+ it { subject.must_equal([0, 18]) }
153
+ end
152
154
 
153
- context 'when x is less than 1' do
154
- let(:x) { -9 }
155
+ context 'when x is less than 1' do
156
+ let(:x) { -9 }
155
157
 
156
- it { subject.must_equal([11, 0]) }
158
+ it { subject.must_equal([11, 0]) }
159
+ end
157
160
  end
158
- end
159
161
 
160
- describe '#down' do
161
- subject { instance.down }
162
+ describe '#down' do
163
+ subject { instance.down }
162
164
 
163
- it { subject.must_be_instance_of(Vedeu::Position) }
164
- it { subject.y.must_equal(13) }
165
- it { subject.x.must_equal(19) }
165
+ it { subject.must_be_instance_of(Vedeu::Geometry::Position) }
166
+ it { subject.y.must_equal(13) }
167
+ it { subject.x.must_equal(19) }
166
168
 
167
- context 'when y is 0' do
168
- let(:y) { 0 }
169
+ context 'when y is 0' do
170
+ let(:y) { 0 }
169
171
 
170
- it { subject.y.must_equal(2) }
172
+ it { subject.y.must_equal(2) }
173
+ end
171
174
  end
172
- end
173
175
 
174
- describe '#left' do
175
- subject { instance.left }
176
+ describe '#left' do
177
+ subject { instance.left }
176
178
 
177
- it { subject.must_be_instance_of(Vedeu::Position) }
178
- it { subject.y.must_equal(12) }
179
- it { subject.x.must_equal(18) }
179
+ it { subject.must_be_instance_of(Vedeu::Geometry::Position) }
180
+ it { subject.y.must_equal(12) }
181
+ it { subject.x.must_equal(18) }
180
182
 
181
- context 'when x is 0' do
182
- let(:x) { 0 }
183
+ context 'when x is 0' do
184
+ let(:x) { 0 }
183
185
 
184
- it { subject.x.must_equal(1) }
186
+ it { subject.x.must_equal(1) }
187
+ end
185
188
  end
186
- end
187
189
 
188
- describe '#right' do
189
- subject { instance.right }
190
+ describe '#right' do
191
+ subject { instance.right }
190
192
 
191
- it { subject.must_be_instance_of(Vedeu::Position) }
192
- it { subject.y.must_equal(12) }
193
- it { subject.x.must_equal(20) }
193
+ it { subject.must_be_instance_of(Vedeu::Geometry::Position) }
194
+ it { subject.y.must_equal(12) }
195
+ it { subject.x.must_equal(20) }
194
196
 
195
- context 'when x is 0' do
196
- let(:x) { 0 }
197
+ context 'when x is 0' do
198
+ let(:x) { 0 }
197
199
 
198
- it { subject.x.must_equal(2) }
200
+ it { subject.x.must_equal(2) }
201
+ end
199
202
  end
200
- end
201
203
 
202
- describe '#up' do
203
- subject { instance.up }
204
+ describe '#up' do
205
+ subject { instance.up }
204
206
 
205
- it { subject.must_be_instance_of(Vedeu::Position) }
206
- it { subject.y.must_equal(11) }
207
- it { subject.x.must_equal(19) }
207
+ it { subject.must_be_instance_of(Vedeu::Geometry::Position) }
208
+ it { subject.y.must_equal(11) }
209
+ it { subject.x.must_equal(19) }
208
210
 
209
- context 'when y is 0' do
210
- let(:y) { 0 }
211
+ context 'when y is 0' do
212
+ let(:y) { 0 }
211
213
 
212
- it { subject.y.must_equal(1) }
214
+ it { subject.y.must_equal(1) }
215
+ end
213
216
  end
214
- end
215
217
 
216
- end # Position
218
+ end # Position
219
+
220
+ end # Geometry
217
221
 
218
222
  end # Vedeu