vedeu 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +40 -0
- data/README.md +1 -0
- data/docs/dsl.md +24 -24
- data/lib/vedeu/all.rb +21 -44
- data/lib/vedeu/api.rb +13 -13
- data/lib/vedeu/application/application_controller.rb +2 -0
- data/lib/vedeu/bindings/movement.rb +53 -18
- data/lib/vedeu/bindings/refresh.rb +1 -1
- data/lib/vedeu/bindings/system.rb +2 -2
- data/lib/vedeu/bindings/visibility.rb +3 -3
- data/lib/vedeu/borders/all.rb +13 -0
- data/lib/vedeu/borders/border.rb +209 -202
- data/lib/vedeu/{dsl/border.rb → borders/dsl.rb} +15 -15
- data/lib/vedeu/{null/border.rb → borders/null.rb} +9 -9
- data/lib/vedeu/borders/render.rb +347 -0
- data/lib/vedeu/borders/repository.rb +19 -0
- data/lib/vedeu/buffers/all.rb +13 -0
- data/lib/vedeu/buffers/buffer.rb +182 -176
- data/lib/vedeu/{null/buffer.rb → buffers/null.rb} +8 -8
- data/lib/vedeu/buffers/repository.rb +24 -0
- data/lib/vedeu/buffers/virtual_buffer.rb +2 -2
- data/lib/vedeu/cursors/all.rb +11 -0
- data/lib/vedeu/cursors/cursor.rb +276 -0
- data/lib/vedeu/cursors/refresh.rb +84 -0
- data/lib/vedeu/cursors/repository.rb +34 -0
- data/lib/vedeu/dsl/interface.rb +9 -9
- data/lib/vedeu/dsl/shared.rb +11 -11
- data/lib/vedeu/{exceptions.rb → error.rb} +2 -2
- data/lib/vedeu/esc/esc.rb +1 -1
- data/lib/vedeu/geometry/all.rb +18 -0
- data/lib/vedeu/geometry/area.rb +170 -160
- data/lib/vedeu/geometry/coordinate.rb +61 -39
- data/lib/vedeu/geometry/dimension.rb +139 -132
- data/lib/vedeu/{dsl/geometry.rb → geometry/dsl.rb} +11 -11
- data/lib/vedeu/geometry/generic_coordinate.rb +159 -153
- data/lib/vedeu/geometry/geometry.rb +310 -212
- data/lib/vedeu/geometry/grid.rb +73 -69
- data/lib/vedeu/{null/geometry.rb → geometry/null.rb} +10 -10
- data/lib/vedeu/geometry/position.rb +124 -120
- data/lib/vedeu/geometry/repository.rb +19 -0
- data/lib/vedeu/input/editor/document.rb +2 -2
- data/lib/vedeu/internal_api.rb +8 -8
- data/lib/vedeu/models/escape.rb +2 -2
- data/lib/vedeu/models/interface.rb +1 -1
- data/lib/vedeu/models/page.rb +89 -0
- data/lib/vedeu/models/row.rb +66 -0
- data/lib/vedeu/models/toggleable.rb +1 -1
- data/lib/vedeu/models/views/char.rb +7 -6
- data/lib/vedeu/models/views/line.rb +1 -1
- data/lib/vedeu/models/views/view.rb +2 -2
- data/lib/vedeu/options.rb +19 -0
- data/lib/vedeu/output/clear/named_interface.rb +1 -1
- data/lib/vedeu/output/direct.rb +1 -1
- data/lib/vedeu/output/presentation.rb +2 -1
- data/lib/vedeu/output/viewport.rb +3 -3
- data/lib/vedeu/repositories/model.rb +9 -1
- data/lib/vedeu/repositories/repository.rb +5 -0
- data/lib/vedeu/terminal/terminal.rb +3 -3
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/borders/border_test.rb +299 -291
- data/test/lib/vedeu/{dsl/border_test.rb → borders/dsl_test.rb} +6 -6
- data/test/lib/vedeu/{null/border_test.rb → borders/null_test.rb} +6 -6
- data/test/lib/vedeu/borders/render_test.rb +125 -0
- data/test/lib/vedeu/borders/repository_test.rb +17 -0
- data/test/lib/vedeu/buffers/buffer_test.rb +116 -112
- data/test/lib/vedeu/{null/buffer_test.rb → buffers/null_test.rb} +5 -5
- data/test/lib/vedeu/buffers/repository_test.rb +18 -0
- data/test/lib/vedeu/cursors/cursor_test.rb +370 -0
- data/test/lib/vedeu/cursors/refresh_test.rb +69 -0
- data/test/lib/vedeu/cursors/repository_test.rb +41 -0
- data/test/lib/vedeu/dsl/interface_test.rb +5 -5
- data/test/lib/vedeu/{exceptions_test.rb → error_test.rb} +0 -0
- data/test/lib/vedeu/geometry/area_test.rb +141 -137
- data/test/lib/vedeu/geometry/coordinate_test.rb +93 -89
- data/test/lib/vedeu/geometry/dimension_test.rb +137 -133
- data/test/lib/vedeu/{dsl/geometry_test.rb → geometry/dsl_test.rb} +17 -17
- data/test/lib/vedeu/geometry/generic_coordinate_test.rb +32 -28
- data/test/lib/vedeu/geometry/geometry_test.rb +282 -157
- data/test/lib/vedeu/geometry/grid_test.rb +35 -31
- data/test/lib/vedeu/{null/geometry_test.rb → geometry/null_test.rb} +5 -5
- data/test/lib/vedeu/geometry/position_test.rb +146 -142
- data/test/lib/vedeu/geometry/repository_test.rb +19 -0
- data/test/lib/vedeu/input/editor/document_test.rb +1 -1
- data/test/lib/vedeu/models/escape_test.rb +1 -1
- data/test/lib/vedeu/models/interface_test.rb +2 -2
- data/test/lib/vedeu/models/page_test.rb +235 -0
- data/test/lib/vedeu/models/row_test.rb +111 -0
- data/test/lib/vedeu/models/views/char_test.rb +3 -3
- data/test/lib/vedeu/options_test.rb +57 -0
- data/test/lib/vedeu/output/clear/named_interface_test.rb +1 -1
- data/test/lib/vedeu/output/renderers/json_test.rb +1 -1
- data/test/lib/vedeu/output/viewport_test.rb +15 -9
- data/test/lib/vedeu/refresh/refresh_buffer_test.rb +12 -12
- data/test/lib/vedeu/repositories/repositories_test.rb +1 -1
- data/test/lib/vedeu/repositories/repository_test.rb +7 -0
- data/test/lib/vedeu/terminal/terminal_test.rb +1 -1
- data/test/test_helper.rb +1 -1
- data/vedeu.gemspec +2 -2
- metadata +57 -63
- data/lib/vedeu/borders/borders.rb +0 -15
- data/lib/vedeu/borders/render_border.rb +0 -331
- data/lib/vedeu/buffers/buffers.rb +0 -20
- data/lib/vedeu/cursor/cursor.rb +0 -174
- data/lib/vedeu/cursor/cursors.rb +0 -30
- data/lib/vedeu/cursor/move.rb +0 -239
- data/lib/vedeu/cursor/reposition.rb +0 -78
- data/lib/vedeu/geometry/geometries.rb +0 -15
- data/lib/vedeu/refresh/refresh_cursor.rb +0 -92
- data/test/lib/vedeu/borders/borders_test.rb +0 -13
- data/test/lib/vedeu/borders/render_border_test.rb +0 -121
- data/test/lib/vedeu/buffers/buffers_test.rb +0 -14
- data/test/lib/vedeu/cursor/cursor_test.rb +0 -246
- data/test/lib/vedeu/cursor/cursors_test.rb +0 -37
- data/test/lib/vedeu/cursor/move_test.rb +0 -301
- data/test/lib/vedeu/cursor/reposition_test.rb +0 -63
- data/test/lib/vedeu/geometry/geometries_test.rb +0 -15
- data/test/lib/vedeu/refresh/refresh_cursor_test.rb +0 -65
@@ -2,187 +2,191 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
module Vedeu
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
{
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
5
|
+
module Geometry
|
6
|
+
|
7
|
+
describe Dimension do
|
8
|
+
|
9
|
+
let(:described) { Vedeu::Geometry::Dimension }
|
10
|
+
let(:instance) { described.new(attributes) }
|
11
|
+
let(:attributes) {
|
12
|
+
{
|
13
|
+
d: d,
|
14
|
+
dn: dn,
|
15
|
+
d_dn: d_dn,
|
16
|
+
default: default,
|
17
|
+
maximised: maximised,
|
18
|
+
centred: centred,
|
19
|
+
}
|
17
20
|
}
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
it { instance.instance_variable_get('@centred').must_equal(centred) }
|
34
|
-
end
|
35
|
-
|
36
|
-
describe '.pair' do
|
37
|
-
let(:d) { 15 }
|
38
|
-
let(:dn) { 38 }
|
39
|
-
|
40
|
-
subject { described.pair(attributes) }
|
41
|
-
|
42
|
-
it { subject.must_be_instance_of(Array) }
|
43
|
-
it { subject.must_equal([15, 38]) }
|
44
|
-
|
45
|
-
context 'when maximised' do
|
46
|
-
let(:maximised) { true }
|
47
|
-
let(:default) { 80 }
|
48
|
-
|
49
|
-
it { subject.must_equal([1, 80]) }
|
21
|
+
let(:d) {}
|
22
|
+
let(:dn) {}
|
23
|
+
let(:d_dn) {}
|
24
|
+
let(:default) {}
|
25
|
+
let(:maximised) {}
|
26
|
+
let(:centred) {}
|
27
|
+
|
28
|
+
describe '#initialize' do
|
29
|
+
it { instance.must_be_instance_of(described) }
|
30
|
+
it { instance.instance_variable_get('@d').must_equal(d) }
|
31
|
+
it { instance.instance_variable_get('@dn').must_equal(dn) }
|
32
|
+
it { instance.instance_variable_get('@d_dn').must_equal(d_dn) }
|
33
|
+
it { instance.instance_variable_get('@default').must_equal(default) }
|
34
|
+
it { instance.instance_variable_get('@maximised').must_equal(maximised) }
|
35
|
+
it { instance.instance_variable_get('@centred').must_equal(centred) }
|
50
36
|
end
|
51
37
|
|
52
|
-
|
53
|
-
let(:
|
54
|
-
let(:
|
38
|
+
describe '.pair' do
|
39
|
+
let(:d) { 15 }
|
40
|
+
let(:dn) { 38 }
|
55
41
|
|
56
|
-
|
57
|
-
let(:d) { 7 }
|
58
|
-
let(:dn) { 47 }
|
42
|
+
subject { described.pair(attributes) }
|
59
43
|
|
60
|
-
|
61
|
-
|
44
|
+
it { subject.must_be_instance_of(Array) }
|
45
|
+
it { subject.must_equal([15, 38]) }
|
62
46
|
|
63
|
-
context 'when
|
64
|
-
let(:
|
47
|
+
context 'when maximised' do
|
48
|
+
let(:maximised) { true }
|
49
|
+
let(:default) { 80 }
|
65
50
|
|
66
|
-
it { subject.must_equal([
|
51
|
+
it { subject.must_equal([1, 80]) }
|
67
52
|
end
|
68
53
|
|
69
|
-
context 'when
|
70
|
-
|
71
|
-
|
72
|
-
end
|
73
|
-
end
|
54
|
+
context 'when centred and a length can be determined' do
|
55
|
+
let(:centred) { true }
|
56
|
+
let(:default) { 80 }
|
74
57
|
|
75
|
-
|
76
|
-
|
58
|
+
context 'when d and dn are given' do
|
59
|
+
let(:d) { 7 }
|
60
|
+
let(:dn) { 47 }
|
77
61
|
|
78
|
-
|
62
|
+
it { subject.must_equal([20, 60]) }
|
63
|
+
end
|
79
64
|
|
80
|
-
|
81
|
-
|
82
|
-
let(:d) { 5 }
|
65
|
+
context 'when only a d_dn is given' do
|
66
|
+
let(:d_dn) { 30 }
|
83
67
|
|
84
|
-
|
85
|
-
|
68
|
+
it { subject.must_equal([28, 52]) }
|
69
|
+
end
|
86
70
|
|
87
|
-
|
88
|
-
|
71
|
+
context 'when only a default is given' do
|
72
|
+
it { subject.must_equal([28, 52]) }
|
73
|
+
end
|
89
74
|
end
|
90
75
|
end
|
91
76
|
|
92
|
-
|
93
|
-
|
94
|
-
let(:default) { 80 }
|
77
|
+
describe '#d1' do
|
78
|
+
subject { instance.d1 }
|
95
79
|
|
96
|
-
|
97
|
-
let(:d) { 7 }
|
98
|
-
let(:dn) { 47 }
|
80
|
+
it { subject.must_be_instance_of(Fixnum) }
|
99
81
|
|
100
|
-
|
101
|
-
|
82
|
+
context 'when not centred and/or a length cannot be determined' do
|
83
|
+
context 'when d is given' do
|
84
|
+
let(:d) { 5 }
|
102
85
|
|
103
|
-
|
104
|
-
|
86
|
+
it { subject.must_equal(5) }
|
87
|
+
end
|
105
88
|
|
106
|
-
|
89
|
+
context 'when d is not given' do
|
90
|
+
it { subject.must_equal(1) }
|
91
|
+
end
|
107
92
|
end
|
108
93
|
|
109
|
-
context 'when
|
110
|
-
|
94
|
+
context 'when centred and a length can be determined' do
|
95
|
+
let(:centred) { true }
|
96
|
+
let(:default) { 80 }
|
97
|
+
|
98
|
+
context 'when d and dn are given' do
|
99
|
+
let(:d) { 7 }
|
100
|
+
let(:dn) { 47 }
|
101
|
+
|
102
|
+
it { subject.must_equal(20) }
|
103
|
+
end
|
104
|
+
|
105
|
+
context 'when only a d_dn is given' do
|
106
|
+
let(:d_dn) { 30 }
|
107
|
+
|
108
|
+
it { subject.must_equal(25) }
|
109
|
+
end
|
110
|
+
|
111
|
+
context 'when only a default is given' do
|
112
|
+
it { subject.must_equal(1) }
|
113
|
+
end
|
111
114
|
end
|
112
115
|
end
|
113
|
-
end
|
114
116
|
|
115
|
-
|
116
|
-
|
117
|
+
describe '#d2' do
|
118
|
+
subject { instance.d2 }
|
117
119
|
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
120
|
+
context 'when not centred and/or a length cannot be determined' do
|
121
|
+
context 'when d and dn are given' do
|
122
|
+
let(:d) { 5 }
|
123
|
+
let(:dn) { 8 }
|
122
124
|
|
123
|
-
|
124
|
-
|
125
|
+
it { subject.must_equal(8) }
|
126
|
+
end
|
125
127
|
|
126
|
-
|
127
|
-
|
128
|
-
|
128
|
+
context 'when d and d_dn are given' do
|
129
|
+
let(:d) { 5 }
|
130
|
+
let(:d_dn) { 2 }
|
129
131
|
|
130
|
-
|
131
|
-
|
132
|
+
it { subject.must_equal(6) }
|
133
|
+
end
|
132
134
|
|
133
|
-
|
134
|
-
|
135
|
+
context 'when only d_dn is given' do
|
136
|
+
let(:d_dn) { 6 }
|
135
137
|
|
136
|
-
|
137
|
-
|
138
|
+
it { subject.must_equal(6) }
|
139
|
+
end
|
138
140
|
|
139
|
-
|
140
|
-
|
141
|
+
context 'when only dn is given' do
|
142
|
+
let(:dn) { 8 }
|
141
143
|
|
142
|
-
|
143
|
-
|
144
|
+
it { subject.must_equal(8) }
|
145
|
+
end
|
144
146
|
|
145
|
-
|
146
|
-
|
147
|
-
|
147
|
+
context 'when d and a default is given' do
|
148
|
+
let(:d) { 1 }
|
149
|
+
let(:default) { 40 }
|
148
150
|
|
149
|
-
|
150
|
-
|
151
|
+
it { subject.must_equal(40) }
|
152
|
+
end
|
151
153
|
|
152
|
-
|
153
|
-
|
154
|
+
context 'when only a default is given' do
|
155
|
+
let(:default) { 25 }
|
154
156
|
|
155
|
-
|
156
|
-
|
157
|
+
it { subject.must_equal(25) }
|
158
|
+
end
|
157
159
|
|
158
|
-
|
159
|
-
|
160
|
+
context 'when no default is given' do
|
161
|
+
it { subject.must_equal(nil) }
|
162
|
+
end
|
160
163
|
end
|
161
|
-
end
|
162
164
|
|
163
|
-
|
164
|
-
|
165
|
-
|
165
|
+
context 'when centred and a length can be determined' do
|
166
|
+
let(:centred) { true }
|
167
|
+
let(:default) { 80 }
|
166
168
|
|
167
|
-
|
168
|
-
|
169
|
-
|
169
|
+
context 'when d and dn are given' do
|
170
|
+
let(:d) { 7 }
|
171
|
+
let(:dn) { 47 }
|
170
172
|
|
171
|
-
|
172
|
-
|
173
|
+
it { subject.must_equal(60) }
|
174
|
+
end
|
173
175
|
|
174
|
-
|
175
|
-
|
176
|
+
context 'when only a d_dn is given' do
|
177
|
+
let(:d_dn) { 30 }
|
176
178
|
|
177
|
-
|
178
|
-
|
179
|
+
it { subject.must_equal(55) }
|
180
|
+
end
|
179
181
|
|
180
|
-
|
181
|
-
|
182
|
+
context 'when only a default is given' do
|
183
|
+
it { subject.must_equal(80) }
|
184
|
+
end
|
182
185
|
end
|
183
186
|
end
|
184
|
-
end
|
185
187
|
|
186
|
-
|
188
|
+
end # Dimension
|
189
|
+
|
190
|
+
end # Geometry
|
187
191
|
|
188
192
|
end # Vedeu
|
@@ -2,13 +2,13 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
module Vedeu
|
4
4
|
|
5
|
-
module
|
5
|
+
module Geometry
|
6
6
|
|
7
|
-
describe
|
7
|
+
describe DSL do
|
8
8
|
|
9
|
-
let(:described) { Vedeu::DSL
|
9
|
+
let(:described) { Vedeu::Geometry::DSL }
|
10
10
|
let(:instance) { described.new(model) }
|
11
|
-
let(:model) { Vedeu::Geometry.new }
|
11
|
+
let(:model) { Vedeu::Geometry::Geometry.new }
|
12
12
|
|
13
13
|
describe '#initialize' do
|
14
14
|
it { instance.must_be_instance_of(described) }
|
@@ -36,7 +36,7 @@ module Vedeu
|
|
36
36
|
end
|
37
37
|
}
|
38
38
|
|
39
|
-
it { subject.must_be_instance_of(Vedeu::Geometry) }
|
39
|
+
it { subject.must_be_instance_of(Vedeu::Geometry::Geometry) }
|
40
40
|
|
41
41
|
it 'allows the use of centred within geometry' do
|
42
42
|
subject.centred.must_equal(false)
|
@@ -90,7 +90,7 @@ module Vedeu
|
|
90
90
|
end
|
91
91
|
}
|
92
92
|
|
93
|
-
it { subject.must_be_instance_of(Vedeu::Geometry) }
|
93
|
+
it { subject.must_be_instance_of(Vedeu::Geometry::Geometry) }
|
94
94
|
|
95
95
|
it 'allows the use of height within geometry' do
|
96
96
|
subject.height.must_equal(17)
|
@@ -153,7 +153,7 @@ module Vedeu
|
|
153
153
|
end
|
154
154
|
}
|
155
155
|
|
156
|
-
it { subject.must_be_instance_of(Vedeu::Geometry) }
|
156
|
+
it { subject.must_be_instance_of(Vedeu::Geometry::Geometry) }
|
157
157
|
|
158
158
|
it 'allows the use of width within geometry' do
|
159
159
|
subject.width.must_equal(29)
|
@@ -172,7 +172,7 @@ module Vedeu
|
|
172
172
|
|
173
173
|
context 'when a block is given' do
|
174
174
|
subject {
|
175
|
-
Vedeu::Geometry.build({}) do
|
175
|
+
Vedeu::Geometry::Geometry.build({}) do
|
176
176
|
x do
|
177
177
|
3 + 4
|
178
178
|
end
|
@@ -189,7 +189,7 @@ module Vedeu
|
|
189
189
|
end
|
190
190
|
}
|
191
191
|
|
192
|
-
it { subject.must_be_instance_of(Vedeu::Geometry) }
|
192
|
+
it { subject.must_be_instance_of(Vedeu::Geometry::Geometry) }
|
193
193
|
|
194
194
|
it 'allows the use of x within geometry' do
|
195
195
|
subject.x.must_equal(9)
|
@@ -207,7 +207,7 @@ module Vedeu
|
|
207
207
|
|
208
208
|
context 'when a block is given' do
|
209
209
|
subject {
|
210
|
-
Vedeu::Geometry.build({}) do
|
210
|
+
Vedeu::Geometry::Geometry.build({}) do
|
211
211
|
x do
|
212
212
|
8 + 8
|
213
213
|
end
|
@@ -230,7 +230,7 @@ module Vedeu
|
|
230
230
|
|
231
231
|
context 'when a block is given' do
|
232
232
|
subject {
|
233
|
-
Vedeu::Geometry.build({}) do
|
233
|
+
Vedeu::Geometry::Geometry.build({}) do
|
234
234
|
y do
|
235
235
|
2 + 7
|
236
236
|
end
|
@@ -247,7 +247,7 @@ module Vedeu
|
|
247
247
|
end
|
248
248
|
}
|
249
249
|
|
250
|
-
it { subject.must_be_instance_of(Vedeu::Geometry) }
|
250
|
+
it { subject.must_be_instance_of(Vedeu::Geometry::Geometry) }
|
251
251
|
|
252
252
|
it 'allows the use of y within geometry' do
|
253
253
|
subject.y.must_equal(4)
|
@@ -265,7 +265,7 @@ module Vedeu
|
|
265
265
|
|
266
266
|
context 'when a block is given' do
|
267
267
|
subject {
|
268
|
-
Vedeu::Geometry.build({}) do
|
268
|
+
Vedeu::Geometry::Geometry.build({}) do
|
269
269
|
y do
|
270
270
|
8 + 8
|
271
271
|
end
|
@@ -285,7 +285,7 @@ module Vedeu
|
|
285
285
|
|
286
286
|
context 'when a block is given' do
|
287
287
|
subject {
|
288
|
-
Vedeu::Geometry.build({}) do
|
288
|
+
Vedeu::Geometry::Geometry.build({}) do
|
289
289
|
xn do
|
290
290
|
8 + 8
|
291
291
|
end
|
@@ -304,7 +304,7 @@ module Vedeu
|
|
304
304
|
|
305
305
|
context 'when a block is given' do
|
306
306
|
subject {
|
307
|
-
Vedeu::Geometry.build({}) do
|
307
|
+
Vedeu::Geometry::Geometry.build({}) do
|
308
308
|
yn do
|
309
309
|
5 + 4
|
310
310
|
end
|
@@ -315,8 +315,8 @@ module Vedeu
|
|
315
315
|
end
|
316
316
|
end
|
317
317
|
|
318
|
-
end #
|
318
|
+
end # DSL
|
319
319
|
|
320
|
-
end #
|
320
|
+
end # Geometry
|
321
321
|
|
322
322
|
end # Vedeu
|
@@ -2,40 +2,44 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
module Vedeu
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
{
|
11
|
-
|
12
|
-
|
13
|
-
|
5
|
+
module Geometry
|
6
|
+
|
7
|
+
describe GenericCoordinate do
|
8
|
+
|
9
|
+
let(:described) { Vedeu::Geometry::GenericCoordinate }
|
10
|
+
let(:instance) { described.new(attributes) }
|
11
|
+
let(:attributes) {
|
12
|
+
{
|
13
|
+
name: _name,
|
14
|
+
offset: offset,
|
15
|
+
type: type,
|
16
|
+
}
|
14
17
|
}
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
let(:type) {}
|
18
|
+
let(:_name) {}
|
19
|
+
let(:offset) {}
|
20
|
+
let(:type) {}
|
19
21
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
describe '#initialize' do
|
23
|
+
it { instance.must_be_instance_of(described) }
|
24
|
+
it { instance.instance_variable_get('@name').must_equal(_name) }
|
25
|
+
it { instance.instance_variable_get('@offset').must_equal(offset) }
|
26
|
+
it { instance.instance_variable_get('@type').must_equal(type) }
|
27
|
+
end
|
26
28
|
|
27
|
-
|
28
|
-
|
29
|
+
describe '#dn' do
|
30
|
+
subject { instance.dn }
|
29
31
|
|
30
|
-
|
31
|
-
|
32
|
+
# it { skip }
|
33
|
+
end
|
32
34
|
|
33
|
-
|
34
|
-
|
35
|
+
describe '#position' do
|
36
|
+
subject { instance.position }
|
35
37
|
|
36
|
-
|
37
|
-
|
38
|
+
# it { skip }
|
39
|
+
end
|
38
40
|
|
39
|
-
|
41
|
+
end # GenericCoordinate
|
42
|
+
|
43
|
+
end # Geometry
|
40
44
|
|
41
45
|
end # Vedeu
|