vedeu 0.4.29 → 0.4.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/Dockerfile +57 -38
  3. data/README.md +10 -110
  4. data/docs/getting_started.md +9 -0
  5. data/lib/vedeu/all.rb +1 -1
  6. data/lib/vedeu/api.rb +6 -5
  7. data/lib/vedeu/buffers/display_buffer.rb +1 -1
  8. data/lib/vedeu/configuration/api.rb +1 -1
  9. data/lib/vedeu/cursor/move.rb +2 -2
  10. data/lib/vedeu/debug.rb +3 -1
  11. data/lib/vedeu/dsl/all.rb +15 -9
  12. data/lib/vedeu/dsl/{components/border.rb → border.rb} +0 -3
  13. data/lib/vedeu/dsl/composition.rb +33 -0
  14. data/lib/vedeu/dsl/{components/geometry.rb → geometry.rb} +18 -0
  15. data/lib/vedeu/dsl/interface.rb +2 -2
  16. data/lib/vedeu/dsl/{components/keymap.rb → keymap.rb} +2 -4
  17. data/lib/vedeu/dsl/{components/menu.rb → menu.rb} +0 -0
  18. data/lib/vedeu/dsl/{shared/presentation.rb → presentation.rb} +0 -0
  19. data/lib/vedeu/dsl/{shared/text.rb → text.rb} +0 -0
  20. data/lib/vedeu/dsl/{shared/use.rb → use.rb} +0 -0
  21. data/lib/vedeu/events/event.rb +11 -53
  22. data/lib/vedeu/geometry/area.rb +1 -2
  23. data/lib/vedeu/geometry/coordinate.rb +1 -1
  24. data/lib/vedeu/geometry/geometry.rb +0 -12
  25. data/lib/vedeu/geometry/position_validator.rb +1 -1
  26. data/lib/vedeu/input/keymap.rb +1 -1
  27. data/lib/vedeu/models/interface.rb +1 -0
  28. data/lib/vedeu/models/panel.rb +2 -0
  29. data/lib/vedeu/null/geometry.rb +3 -2
  30. data/lib/vedeu/output/border.rb +6 -6
  31. data/lib/vedeu/output/clear.rb +4 -4
  32. data/lib/vedeu/output/compressor.rb +10 -4
  33. data/lib/vedeu/output/html_char.rb +4 -4
  34. data/lib/vedeu/output/refresh.rb +3 -3
  35. data/lib/vedeu/output/renderers/file.rb +1 -1
  36. data/lib/vedeu/output/renderers/terminal.rb +2 -2
  37. data/lib/vedeu/output/renderers/text.rb +1 -1
  38. data/lib/vedeu/output/style.rb +1 -1
  39. data/lib/vedeu/output/translator.rb +0 -8
  40. data/lib/vedeu/output/viewport.rb +1 -1
  41. data/lib/vedeu/repositories/all.rb +1 -1
  42. data/lib/vedeu/repositories/repository.rb +1 -1
  43. data/lib/vedeu/support/common.rb +1 -1
  44. data/lib/vedeu/support/template.rb +1 -1
  45. data/lib/vedeu/support/timer.rb +11 -14
  46. data/lib/vedeu/templating/all.rb +9 -0
  47. data/lib/vedeu/templating/helpers.rb +9 -3
  48. data/lib/vedeu/templating/preprocessor.rb +4 -1
  49. data/lib/vedeu/version.rb +3 -0
  50. data/test/lib/vedeu/api_test.rb +38 -297
  51. data/test/lib/vedeu/buffers/display_buffer_test.rb +1 -0
  52. data/test/lib/vedeu/dsl/{components/border_test.rb → border_test.rb} +0 -0
  53. data/test/lib/vedeu/dsl/{components/geometry_test.rb → geometry_test.rb} +0 -0
  54. data/test/lib/vedeu/dsl/{components/keymap_test.rb → keymap_test.rb} +0 -0
  55. data/test/lib/vedeu/dsl/{components/menu_test.rb → menu_test.rb} +0 -0
  56. data/test/lib/vedeu/dsl/{shared/presentation_test.rb → presentation_test.rb} +0 -0
  57. data/test/lib/vedeu/dsl/{shared/text_test.rb → text_test.rb} +0 -0
  58. data/test/lib/vedeu/dsl/{shared/use_test.rb → use_test.rb} +0 -0
  59. data/test/lib/vedeu/dsl/view_test.rb +2 -0
  60. data/test/lib/vedeu/main_loop_test.rb +0 -3
  61. data/test/lib/vedeu/output/background_test.rb +18 -22
  62. data/test/lib/vedeu/output/compressor_test.rb +4 -0
  63. data/test/lib/vedeu/output/foreground_test.rb +13 -17
  64. data/test/lib/vedeu/repositories/repositories/borders_test.rb +2 -1
  65. data/test/lib/vedeu/repositories/repositories/buffers_test.rb +5 -1
  66. data/test/lib/vedeu/repositories/repositories/geometries_test.rb +2 -0
  67. data/test/lib/vedeu/support/common_test.rb +2 -2
  68. data/test/lib/vedeu/support/timer_test.rb +4 -6
  69. data/test/test_helper.rb +22 -0
  70. data/vedeu.gemspec +3 -1
  71. metadata +24 -25
  72. data/lib/vedeu/dsl/components/all.rb +0 -4
  73. data/lib/vedeu/dsl/shared/all.rb +0 -3
@@ -4,303 +4,44 @@ module Vedeu
4
4
 
5
5
  describe API do
6
6
 
7
- describe 'Forwardable' do
8
-
9
- describe 'Vedeu::BackgroundColours' do
10
- describe '.background_colours' do
11
- subject { Vedeu.background_colours }
12
-
13
- # it { subject.must_be_instance_of(Vedeu::BackgroundColours) }
14
- end
15
- end
16
-
17
- describe 'Vedeu::Borders' do
18
- describe '.borders' do
19
- subject { Vedeu.borders }
20
-
21
- it { subject.must_be_instance_of(Vedeu::Borders) }
22
- end
23
- end
24
-
25
- describe 'Vedeu::Buffers' do
26
- describe '.buffers' do
27
- subject { Vedeu.buffers }
28
-
29
- it { subject.must_be_instance_of(Vedeu::Buffers) }
30
- end
31
- end
32
-
33
- describe 'Vedeu::Configuration' do
34
- describe '.configure' do
35
- subject { Vedeu.configure }
36
-
37
- # it { subject.must_be_instance_of(NilClass) }
38
- end
39
-
40
- describe '.configuration' do
41
- subject { Vedeu.configuration }
42
-
43
- it { subject.must_be_instance_of(Vedeu::Configuration) }
44
- end
45
- end
46
-
47
- describe 'Vedeu::Cursors' do
48
- describe '.cursor' do
49
- subject { Vedeu.cursor }
50
-
51
- # when all tests run
52
- # it { subject.must_be_instance_of(Vedeu::Cursor) }
53
-
54
- # when just this test runs
55
- # it { subject.must_be_instance_of(NilClass) }
56
- end
57
-
58
- describe '.cursors' do
59
- subject { Vedeu.cursors }
60
-
61
- it { subject.must_be_instance_of(Vedeu::Cursors) }
62
- end
63
- end
64
-
65
- describe 'Vedeu::DSL::Border' do
66
- describe '.border' do
67
- let(:arg) {}
68
-
69
- subject { Vedeu.border(arg) {} }
70
-
71
- # it { subject.must_be_instance_of(NilClass) }
72
- end
73
- end
74
-
75
- describe 'Vedeu::DSL::Geometry' do
76
- describe '.geometry' do
77
- let(:arg) {}
78
-
79
- subject { Vedeu.geometry(arg) { } }
80
-
81
- # it { subject.must_be_instance_of(NilClass) }
82
- end
83
- end
84
-
85
- describe 'Vedeu::DSL::Group' do
86
- describe '.group' do
87
- let(:arg) {}
88
-
89
- subject { Vedeu.group(arg) { } }
90
-
91
- # it { subject.must_be_instance_of(NilClass) }
92
- end
93
- end
94
-
95
- describe 'Vedeu::DSL::Keymap' do
96
- describe '.keymap' do
97
- let(:arg) {}
98
-
99
- subject { Vedeu.keymap(arg) }
100
-
101
- # it { subject.must_be_instance_of(NilClass) }
102
- end
103
- end
104
-
105
- describe 'Vedeu::DSL::View' do
106
- describe '.interface' do
107
- subject { Vedeu.interface { } }
108
-
109
- # it { subject.must_be_instance_of(NilClass) }
110
- end
111
-
112
- describe '.renders' do
113
- subject { Vedeu.renders { } }
114
-
115
- # it { subject.must_be_instance_of(Array) }
116
- end
117
-
118
- describe '.views' do
119
- subject { Vedeu.views { } }
120
-
121
- # it { subject.must_be_instance_of(Array) }
122
- end
123
- end
124
-
125
- describe 'Vedeu::Event' do
126
- describe '.bind' do
127
- let(:args) {}
128
-
129
- subject { Vedeu.bind(args) }
130
-
131
- # it { subject.must_be_instance_of(NilClass) }
132
- end
133
-
134
- describe '.unbind' do
135
- let(:args) {}
136
-
137
- subject { Vedeu.unbind(args) }
138
-
139
- # it { subject.must_be_instance_of(FalseClass) }
140
- end
141
- end
142
-
143
- describe 'Vedeu::EventsRepository' do
144
- describe '.events' do
145
- subject { Vedeu.events }
146
-
147
- it { subject.must_be_instance_of(Vedeu::EventsRepository) }
148
- end
149
- end
150
-
151
- describe 'Vedeu::Focus' do
152
- describe '.focus' do
153
- subject { Vedeu.focus }
154
-
155
- # it { subject.must_be_instance_of(NilClass) }
156
- end
157
-
158
- describe '.focus_by_name' do
159
- let(:_name) {}
160
-
161
- subject { Vedeu.focus_by_name(_name) }
162
-
163
- # it { subject.must_be_instance_of(NilClass) }
164
- end
165
-
166
- describe '.focussed?' do
167
- let(:arg) {}
168
-
169
- subject { Vedeu.focussed?(arg) }
170
-
171
- # it { subject.must_be_instance_of(TrueClass) }
172
- end
173
-
174
- describe '.focus_next' do
175
- subject { Vedeu.focus_next }
176
-
177
- # it { subject.must_be_instance_of(FalseClass) }
178
- end
179
-
180
- describe '.focus_previous' do
181
- subject { Vedeu.focus_previous }
182
-
183
- # it { subject.must_be_instance_of(FalseClass) }
184
- end
185
- end
186
-
187
- describe 'Vedeu::ForegroundColours' do
188
- describe '.foreground_colours' do
189
- subject { Vedeu.foreground_colours }
190
-
191
- # it { subject.must_be_instance_of(Vedeu::ForegroundColours) }
192
- end
193
- end
194
-
195
- describe 'Vedeu::Geometries' do
196
- describe '.geometries' do
197
- subject { Vedeu.geometries }
198
-
199
- it { subject.must_be_instance_of(Vedeu::Geometries) }
200
- end
201
- end
202
-
203
- describe 'Vedeu::Groups' do
204
- describe '.groups' do
205
- subject { Vedeu.groups }
206
-
207
- it { subject.must_be_instance_of(Vedeu::Groups) }
208
- end
209
- end
210
-
211
- describe 'Vedeu::InterfacesRepository' do
212
- describe '.interfaces' do
213
- subject { Vedeu.interfaces }
214
-
215
- it { subject.must_be_instance_of(Vedeu::InterfacesRepository) }
216
- end
217
- end
218
-
219
- describe 'Vedeu::Keymaps' do
220
- describe '.keymaps' do
221
- subject { Vedeu.keymaps }
222
-
223
- it { subject.must_be_instance_of(Vedeu::Keymaps) }
224
- end
225
- end
226
-
227
- describe 'Vedeu::Log' do
228
- describe '.log' do
229
- subject { Vedeu.log(message: '') }
230
-
231
- # it { subject.must_be_instance_of(NilClass) }
232
- end
233
- end
234
-
235
- describe 'Vedeu::Mapper' do
236
- describe '.keypress' do
237
- subject { Vedeu.keypress }
238
-
239
- # it { subject.must_be_instance_of(FalseClass) }
240
- end
241
- end
242
-
243
- describe 'Vedeu::Menu' do
244
- describe '.menu' do
245
- subject { Vedeu.menu { } }
246
-
247
- # it { subject.must_be_instance_of(NilClass) }
248
- end
249
- end
250
-
251
- describe 'Vedeu::Menus' do
252
- describe '.menus' do
253
- subject { Vedeu.menus }
254
-
255
- it { subject.must_be_instance_of(Vedeu::Menus) }
256
- end
257
- end
258
-
259
- describe 'Vedeu::Renderers' do
260
- describe '.renderer' do
261
- subject { Vedeu.renderer }
262
-
263
- # it { subject.must_be_instance_of(Set) }
264
- end
265
-
266
- describe '.renderers' do
267
- subject { Vedeu.renderers }
268
-
269
- # it { subject.must_be_instance_of(Module) }
270
- end
271
- end
272
-
273
- describe 'Vedeu::Terminal' do
274
- describe '.height' do
275
- subject { Vedeu.height }
276
-
277
- # it { subject.must_be_instance_of(Fixnum) }
278
- end
279
-
280
- describe '.width' do
281
- subject { Vedeu.width }
282
-
283
- # it { subject.must_be_instance_of(Fixnum) }
284
- end
285
-
286
- describe '.resize' do
287
- subject { Vedeu.resize }
288
-
289
- # it { subject.must_be_instance_of(TrueClass) }
290
- end
291
- end
292
-
293
- describe 'Vedeu::Trigger' do
294
- describe '.trigger' do
295
- let(:args) {}
296
-
297
- subject { Vedeu.trigger(args) }
298
-
299
- # it { subject.must_be_instance_of(Array) }
300
- end
301
- end
302
-
303
- end
7
+ it { Vedeu.must_respond_to(:background_colours) }
8
+ it { Vedeu.must_respond_to(:borders) }
9
+ it { Vedeu.must_respond_to(:buffers) }
10
+ it { Vedeu.must_respond_to(:configure) }
11
+ it { Vedeu.must_respond_to(:configuration) }
12
+ it { Vedeu.must_respond_to(:cursor) }
13
+ it { Vedeu.must_respond_to(:cursors) }
14
+ it { Vedeu.must_respond_to(:border) }
15
+ it { Vedeu.must_respond_to(:geometry) }
16
+ it { Vedeu.must_respond_to(:group) }
17
+ it { Vedeu.must_respond_to(:keymap) }
18
+ it { Vedeu.must_respond_to(:interface) }
19
+ it { Vedeu.must_respond_to(:renders) }
20
+ it { Vedeu.must_respond_to(:views) }
21
+ it { Vedeu.must_respond_to(:bind) }
22
+ it { Vedeu.must_respond_to(:unbind) }
23
+ it { Vedeu.must_respond_to(:events) }
24
+ it { Vedeu.must_respond_to(:focus) }
25
+ it { Vedeu.must_respond_to(:focus_by_name) }
26
+ it { Vedeu.must_respond_to(:focussed?) }
27
+ it { Vedeu.must_respond_to(:focus_next) }
28
+ it { Vedeu.must_respond_to(:focus_previous) }
29
+ it { Vedeu.must_respond_to(:foreground_colours) }
30
+ it { Vedeu.must_respond_to(:geometries) }
31
+ it { Vedeu.must_respond_to(:groups) }
32
+ it { Vedeu.must_respond_to(:interfaces) }
33
+ it { Vedeu.must_respond_to(:keymaps) }
34
+ it { Vedeu.must_respond_to(:log) }
35
+ it { Vedeu.must_respond_to(:keypress) }
36
+ it { Vedeu.must_respond_to(:menu) }
37
+ it { Vedeu.must_respond_to(:menus) }
38
+ it { Vedeu.must_respond_to(:renderer) }
39
+ it { Vedeu.must_respond_to(:renderers) }
40
+ it { Vedeu.must_respond_to(:height) }
41
+ it { Vedeu.must_respond_to(:width) }
42
+ it { Vedeu.must_respond_to(:resize) }
43
+ it { Vedeu.must_respond_to(:timer) }
44
+ it { Vedeu.must_respond_to(:trigger) }
304
45
 
305
46
  end # API
306
47
 
@@ -36,6 +36,7 @@ module Vedeu
36
36
 
37
37
  Vedeu::Refresh.stubs(:by_name)
38
38
  end
39
+ after { Vedeu.interfaces.reset }
39
40
 
40
41
  describe '#store_immediate' do
41
42
  subject { example_instance.store_immediate }
@@ -9,6 +9,8 @@ module Vedeu
9
9
  let(:described) { Vedeu::DSL::View }
10
10
 
11
11
  describe '.interface' do
12
+ after { Vedeu.interfaces.reset }
13
+
12
14
  subject {
13
15
  described.interface('flourine') do
14
16
  # ...
@@ -7,9 +7,6 @@ module Vedeu
7
7
  let(:described) { Vedeu::MainLoop }
8
8
 
9
9
  describe '.start!' do
10
- before do
11
- end
12
-
13
10
  subject { described.start! { } }
14
11
  end
15
12
 
@@ -10,14 +10,16 @@ module Vedeu
10
10
 
11
11
  before { Vedeu.background_colours.reset! }
12
12
 
13
- describe '.escape_sequence' do
14
- describe 'when the colour is empty' do
15
- it 'returns an empty String' do
16
- Background.escape_sequence('').must_equal('')
17
- end
13
+ describe '#escape_sequence' do
14
+ subject { instance.escape_sequence }
15
+
16
+ context 'when the colour is empty' do
17
+ let(:colour) { '' }
18
+
19
+ it { subject.must_equal('') }
18
20
  end
19
21
 
20
- describe 'when the colour is named (3-bit / 8 colours)' do
22
+ context 'when the colour is named (3-bit / 8 colours)' do
21
23
  {
22
24
  red: "\e[41m",
23
25
  yellow: "\e[43m",
@@ -27,12 +29,12 @@ module Vedeu
27
29
  unknown: '',
28
30
  }.map do |colour, result|
29
31
  it "returns the correct escape sequence for #{colour}" do
30
- Background.escape_sequence(colour).must_equal(result)
32
+ described.new(colour).escape_sequence.must_equal(result)
31
33
  end
32
34
  end
33
35
  end
34
36
 
35
- describe 'when the colour is numbered (8-bit / 256 colours)' do
37
+ context 'when the colour is numbered (8-bit / 256 colours)' do
36
38
  {
37
39
  24 => "\e[48;5;24m",
38
40
  56 => "\e[48;5;56m",
@@ -44,12 +46,12 @@ module Vedeu
44
46
  442 => ''
45
47
  }.map do |colour, result|
46
48
  it "returns the correct escape sequence for #{colour}" do
47
- Background.escape_sequence(colour).must_equal(result)
49
+ described.new(colour).escape_sequence.must_equal(result)
48
50
  end
49
51
  end
50
52
  end
51
53
 
52
- describe 'when the colour is a CSS value (8-bit / 256 colours)' do
54
+ context 'when the colour is a CSS value (8-bit / 256 colours)' do
53
55
  before { Configuration.stubs(:colour_mode).returns(8) }
54
56
 
55
57
  {
@@ -64,12 +66,12 @@ module Vedeu
64
66
  '#h11111' => '',
65
67
  }.map do |colour, result|
66
68
  it "returns the correct escape sequence for #{colour}" do
67
- Background.escape_sequence(colour).must_equal(result)
69
+ described.new(colour).escape_sequence.must_equal(result)
68
70
  end
69
71
  end
70
72
  end
71
73
 
72
- describe 'when the colour is a CSS value (24-bit / 16.8mil colours)' do
74
+ context 'when the colour is a CSS value (24-bit / 16.8mil colours)' do
73
75
  {
74
76
  '#5f0000' => "\e[48;2;95;0;0m",
75
77
  '#008700' => "\e[48;2;0;135;0m",
@@ -82,7 +84,7 @@ module Vedeu
82
84
  '#h11111' => '',
83
85
  }.map do |colour, result|
84
86
  it "returns the correct escape sequence for #{colour}" do
85
- Background.escape_sequence(colour).must_equal(result)
87
+ described.new(colour).escape_sequence.must_equal(result)
86
88
  end
87
89
  end
88
90
  end
@@ -94,25 +96,19 @@ module Vedeu
94
96
  context 'when the colour is empty' do
95
97
  let(:colour) {}
96
98
 
97
- it 'returns an empty String' do
98
- subject.must_equal('')
99
- end
99
+ it { subject.must_equal('') }
100
100
  end
101
101
 
102
102
  context 'when the colour is named (3-bit / 8 colours)' do
103
103
  let(:colour) { :red }
104
104
 
105
- it 'returns an empty String' do
106
- subject.must_equal('')
107
- end
105
+ it { subject.must_equal('') }
108
106
  end
109
107
 
110
108
  context 'when the colour is numbered (8-bit / 256 colours)' do
111
109
  let(:colour) { 118 }
112
110
 
113
- it 'returns an empty String' do
114
- subject.must_equal('')
115
- end
111
+ it { subject.must_equal('') }
116
112
  end
117
113
 
118
114
  context 'when the colour is a CSS value' do
@@ -15,6 +15,10 @@ module Vedeu
15
15
  it { instance.instance_variable_get('@style').must_equal('') }
16
16
  end
17
17
 
18
+ describe '.render' do
19
+ it { described.must_respond_to(:render) }
20
+ end
21
+
18
22
  describe '#render' do
19
23
  subject { instance.render }
20
24
 
@@ -10,11 +10,13 @@ module Vedeu
10
10
 
11
11
  before { Vedeu.foreground_colours.reset! }
12
12
 
13
- describe '.escape_sequence' do
13
+ describe '#escape_sequence' do
14
+ subject { instance.escape_sequence }
15
+
14
16
  context 'when the colour is empty' do
15
- it 'returns an empty String' do
16
- Foreground.escape_sequence('').must_equal('')
17
- end
17
+ let(:colour) { '' }
18
+
19
+ it { subject.must_equal('') }
18
20
  end
19
21
 
20
22
  context 'when the colour is named (3-bit / 8 colours)' do
@@ -27,7 +29,7 @@ module Vedeu
27
29
  unknown: '',
28
30
  }.map do |colour, result|
29
31
  it "returns the correct escape sequence for #{colour}" do
30
- Foreground.escape_sequence(colour).must_equal(result)
32
+ described.new(colour).escape_sequence.must_equal(result)
31
33
  end
32
34
  end
33
35
  end
@@ -44,7 +46,7 @@ module Vedeu
44
46
  442 => ''
45
47
  }.map do |colour, result|
46
48
  it "returns the correct escape sequence for #{colour}" do
47
- Foreground.escape_sequence(colour).must_equal(result)
49
+ described.new(colour).escape_sequence.must_equal(result)
48
50
  end
49
51
  end
50
52
  end
@@ -64,7 +66,7 @@ module Vedeu
64
66
  '#h11111' => '',
65
67
  }.map do |colour, result|
66
68
  it "returns the correct escape sequence for #{colour}" do
67
- Foreground.escape_sequence(colour).must_equal(result)
69
+ described.new(colour).escape_sequence.must_equal(result)
68
70
  end
69
71
  end
70
72
  end
@@ -82,7 +84,7 @@ module Vedeu
82
84
  '#h11111' => '',
83
85
  }.map do |colour, result|
84
86
  it "returns the correct escape sequence for #{colour}" do
85
- Foreground.escape_sequence(colour).must_equal(result)
87
+ described.new(colour).escape_sequence.must_equal(result)
86
88
  end
87
89
  end
88
90
  end
@@ -94,25 +96,19 @@ module Vedeu
94
96
  context 'when the colour is empty' do
95
97
  let(:colour) {}
96
98
 
97
- it 'returns an empty String' do
98
- subject.must_equal('')
99
- end
99
+ it { subject.must_equal('') }
100
100
  end
101
101
 
102
102
  context 'when the colour is named (3-bit / 8 colours)' do
103
103
  let(:colour) { :red }
104
104
 
105
- it 'returns an empty String' do
106
- subject.must_equal('')
107
- end
105
+ it { subject.must_equal('') }
108
106
  end
109
107
 
110
108
  context 'when the colour is numbered (8-bit / 256 colours)' do
111
109
  let(:colour) { 118 }
112
110
 
113
- it 'returns an empty String' do
114
- subject.must_equal('')
115
- end
111
+ it { subject.must_equal('') }
116
112
  end
117
113
 
118
114
  context 'when the colour is a CSS value' do
@@ -6,6 +6,8 @@ module Vedeu
6
6
 
7
7
  let(:described) { Vedeu::Borders }
8
8
 
9
+ after { Vedeu.borders.reset }
10
+
9
11
  describe '#by_name' do
10
12
  let(:_name) { 'carbon' }
11
13
 
@@ -16,7 +18,6 @@ module Vedeu
16
18
  Vedeu.border 'carbon' do
17
19
  end
18
20
  end
19
- after { Vedeu.borders.reset }
20
21
 
21
22
  it { subject.must_be_instance_of(Vedeu::Border) }
22
23
  end
@@ -7,6 +7,11 @@ module Vedeu
7
7
  let(:described) { Vedeu::Buffers }
8
8
  let(:instance) { described.buffers }
9
9
 
10
+ after do
11
+ Vedeu.buffers.reset
12
+ Vedeu.interfaces.reset
13
+ end
14
+
10
15
  describe '#by_name' do
11
16
  let(:_name) { 'carbon' }
12
17
 
@@ -17,7 +22,6 @@ module Vedeu
17
22
  Vedeu.interface 'carbon' do
18
23
  end
19
24
  end
20
- after { Vedeu.buffers.reset }
21
25
 
22
26
  it { subject.must_be_instance_of(Vedeu::Buffer) }
23
27
  end
@@ -6,6 +6,8 @@ module Vedeu
6
6
 
7
7
  let(:described) { Vedeu::Geometries }
8
8
 
9
+ after { Vedeu.geometries.reset }
10
+
9
11
  describe '#by_name' do
10
12
  let(:_name) { 'carbon' }
11
13
 
@@ -7,7 +7,7 @@ module Vedeu
7
7
  include Vedeu::Common
8
8
 
9
9
  def defined_value_test(variable)
10
- defined_value?(variable)
10
+ present?(variable)
11
11
  end
12
12
 
13
13
  end # VedeuCommonClass
@@ -16,7 +16,7 @@ module Vedeu
16
16
 
17
17
  let(:described) { Vedeu::VedeuCommonClass.new }
18
18
 
19
- describe '#defined_value?' do
19
+ describe '#present?' do
20
20
  subject { described.defined_value_test(_value) }
21
21
 
22
22
  context 'when the variable is a Fixnum' do
@@ -5,8 +5,7 @@ module Vedeu
5
5
  describe Timer do
6
6
 
7
7
  let(:described) { Vedeu::Timer }
8
- let(:instance) { described.new(type, _message) }
9
- let(:type) { :debug }
8
+ let(:instance) { described.new(_message) }
10
9
  let(:_message) { 'Testing' }
11
10
  let(:_time) { mock('Time') }
12
11
  let(:started) { 1434492219.5238185 }
@@ -18,20 +17,19 @@ module Vedeu
18
17
 
19
18
  describe '#initialize' do
20
19
  it { instance.must_be_instance_of(described) }
21
- it { instance.instance_variable_get('@type').must_equal(type) }
22
20
  it { instance.instance_variable_get('@message').must_equal(_message) }
23
21
  it { instance.instance_variable_get('@started').must_equal(started) }
24
22
  end
25
23
 
26
- describe '.for' do
27
- it { described.must_respond_to(:for) }
24
+ describe '.timer' do
25
+ it { described.must_respond_to(:timer) }
28
26
  end
29
27
 
30
28
  describe '#measure' do
31
29
  subject { instance.measure { } }
32
30
 
33
31
  it {
34
- Vedeu.expects(:log).with(type: :debug,
32
+ Vedeu.expects(:log).with(type: :timer,
35
33
  message: "Testing took 0ms.")
36
34
  subject
37
35
  }