vedeu 0.4.33 → 0.4.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vedeu/bindings.rb +11 -0
- data/lib/vedeu/configuration/configuration.rb +6 -0
- data/lib/vedeu/dsl/geometry.rb +5 -0
- data/lib/vedeu/events/event.rb +3 -1
- data/lib/vedeu/input/mapper.rb +3 -0
- data/lib/vedeu/models/focus.rb +15 -0
- data/lib/vedeu/output/renderers/all.rb +9 -0
- data/lib/vedeu/repositories/repositories/background_colours.rb +3 -0
- data/lib/vedeu/repositories/repositories/borders.rb +6 -0
- data/lib/vedeu/repositories/repositories/buffers.rb +6 -0
- data/lib/vedeu/repositories/repositories/cursors.rb +12 -0
- data/lib/vedeu/repositories/repositories/events_repository.rb +6 -0
- data/lib/vedeu/repositories/repositories/foreground_colours.rb +3 -0
- data/lib/vedeu/repositories/repositories/geometries.rb +6 -0
- data/lib/vedeu/repositories/repositories/groups.rb +9 -0
- data/lib/vedeu/repositories/repositories/interfaces_repository.rb +9 -0
- data/lib/vedeu/repositories/repositories/keymaps.rb +6 -0
- data/lib/vedeu/repositories/repositories/menus.rb +6 -0
- data/lib/vedeu/support/terminal.rb +3 -0
- data/lib/vedeu/support/timer.rb +5 -0
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/buffers/buffer_test.rb +159 -93
- data/test/lib/vedeu/configuration/api_test.rb +36 -10
- data/test/lib/vedeu/configuration/cli_test.rb +27 -27
- data/test/lib/vedeu/configuration/configuration_test.rb +8 -7
- data/test/lib/vedeu/cursor/cursor_test.rb +34 -0
- data/test/lib/vedeu/cursor/move_test.rb +32 -2
- data/test/lib/vedeu/distributed/client_test.rb +3 -5
- data/test/lib/vedeu/distributed/server_test.rb +37 -14
- data/test/lib/vedeu/distributed/subprocess_test.rb +12 -0
- data/test/lib/vedeu/distributed/uri_test.rb +2 -0
- data/test/lib/vedeu/dsl/border_test.rb +5 -7
- data/test/lib/vedeu/dsl/geometry_test.rb +6 -4
- data/test/lib/vedeu/dsl/line_test.rb +0 -4
- data/test/lib/vedeu/dsl/presentation_test.rb +8 -7
- data/test/lib/vedeu/events/event_test.rb +6 -6
- data/test/lib/vedeu/geometry/geometry_test.rb +53 -0
- data/test/lib/vedeu/input/keymap_test.rb +4 -0
- data/test/lib/vedeu/models/char_test.rb +24 -0
- data/test/lib/vedeu/models/group_test.rb +4 -0
- data/test/lib/vedeu/models/interface_test.rb +65 -0
- data/test/lib/vedeu/models/menu_test.rb +24 -0
- data/test/lib/vedeu/models/stream_test.rb +23 -0
- data/test/lib/vedeu/null/geometry_test.rb +12 -0
- data/test/lib/vedeu/output/border_test.rb +109 -0
- data/test/lib/vedeu/output/clear_test.rb +8 -8
- data/test/lib/vedeu/output/renderers/all_test.rb +16 -16
- data/test/lib/vedeu/output/style_test.rb +8 -0
- data/test/lib/vedeu/output/virtual_terminal_test.rb +14 -18
- data/test/lib/vedeu/repositories/collection_test.rb +21 -0
- data/test/lib/vedeu/repositories/model_test.rb +8 -0
- metadata +2 -2
@@ -37,6 +37,34 @@ module Vedeu
|
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
+
describe '#back' do
|
41
|
+
it { instance.must_respond_to(:back) }
|
42
|
+
end
|
43
|
+
|
44
|
+
describe '#back=' do
|
45
|
+
it { instance.must_respond_to(:back=) }
|
46
|
+
end
|
47
|
+
|
48
|
+
describe '#front' do
|
49
|
+
it { instance.must_respond_to(:front) }
|
50
|
+
end
|
51
|
+
|
52
|
+
describe '#front=' do
|
53
|
+
it { instance.must_respond_to(:front=) }
|
54
|
+
end
|
55
|
+
|
56
|
+
describe '#previous' do
|
57
|
+
it { instance.must_respond_to(:previous) }
|
58
|
+
end
|
59
|
+
|
60
|
+
describe '#previous=' do
|
61
|
+
it { instance.must_respond_to(:previous=) }
|
62
|
+
end
|
63
|
+
|
64
|
+
describe '#name' do
|
65
|
+
it { instance.must_respond_to(:name) }
|
66
|
+
end
|
67
|
+
|
40
68
|
describe '#add' do
|
41
69
|
let(:back) {
|
42
70
|
Vedeu.interface 'buffer' do
|
@@ -66,12 +94,48 @@ module Vedeu
|
|
66
94
|
end
|
67
95
|
end
|
68
96
|
|
97
|
+
describe '#back?' do
|
98
|
+
subject { instance.back? }
|
99
|
+
|
100
|
+
context 'with content' do
|
101
|
+
# it { subject.must_equal(true) }
|
102
|
+
end
|
103
|
+
|
104
|
+
context 'without content' do
|
105
|
+
it { subject.must_equal(false) }
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
69
109
|
describe '#clear' do
|
70
110
|
subject { instance.clear }
|
71
111
|
|
72
112
|
it { subject.must_be_instance_of(Array) }
|
73
113
|
end
|
74
114
|
|
115
|
+
describe '#front?' do
|
116
|
+
subject { instance.front? }
|
117
|
+
|
118
|
+
context 'with content' do
|
119
|
+
# it { subject.must_equal(true) }
|
120
|
+
end
|
121
|
+
|
122
|
+
context 'without content' do
|
123
|
+
it { subject.must_equal(false) }
|
124
|
+
end
|
125
|
+
end
|
126
|
+
|
127
|
+
describe '#previous?' do
|
128
|
+
subject { instance.previous? }
|
129
|
+
|
130
|
+
context 'with content' do
|
131
|
+
# it { subject.must_equal(true) }
|
132
|
+
end
|
133
|
+
|
134
|
+
context 'without content' do
|
135
|
+
it { subject.must_equal(false) }
|
136
|
+
end
|
137
|
+
end
|
138
|
+
|
75
139
|
describe '#hide' do
|
76
140
|
subject { instance.hide }
|
77
141
|
|
@@ -94,99 +158,101 @@ module Vedeu
|
|
94
158
|
end
|
95
159
|
end
|
96
160
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
161
|
+
describe '#render' do
|
162
|
+
before { Vedeu::Output.stubs(:render) }
|
163
|
+
|
164
|
+
subject { instance.render }
|
165
|
+
|
166
|
+
it { instance.must_respond_to(:content) }
|
167
|
+
|
168
|
+
# it { subject.must_be_instance_of(Array) }
|
169
|
+
|
170
|
+
# context 'when there is content on the back buffer' do
|
171
|
+
# let(:back) {
|
172
|
+
# Vedeu.interface 'buffer' do
|
173
|
+
# lines do
|
174
|
+
# line 'old_back'
|
175
|
+
# end
|
176
|
+
# end
|
177
|
+
# }
|
178
|
+
# let(:front) {
|
179
|
+
# Vedeu.interface 'buffer' do
|
180
|
+
# lines do
|
181
|
+
# line 'front'
|
182
|
+
# end
|
183
|
+
# end
|
184
|
+
# }
|
185
|
+
# let(:previous) {
|
186
|
+
# Vedeu.interface 'buffer' do
|
187
|
+
# lines do
|
188
|
+
# line 'previous'
|
189
|
+
# end
|
190
|
+
# end
|
191
|
+
# }
|
192
|
+
# let(:buffer) { :back }
|
193
|
+
|
194
|
+
# it { subject.must_equal([back]) }
|
195
|
+
|
196
|
+
# it 'replaces the previous buffer with the front buffer' do
|
197
|
+
# subject
|
198
|
+
# instance.previous.must_equal(front)
|
199
|
+
# end
|
200
|
+
|
201
|
+
# it 'replaces the front buffer with the back buffer' do
|
202
|
+
# subject
|
203
|
+
# instance.front.must_equal(back)
|
204
|
+
# end
|
205
|
+
|
206
|
+
# it 'replaces the back buffer with an empty buffer' do
|
207
|
+
# subject
|
208
|
+
# instance.back.must_equal(nil)
|
209
|
+
# end
|
210
|
+
# end
|
211
|
+
|
212
|
+
# context 'when there is no content on the back buffer' do
|
213
|
+
# let(:buffer) { :back }
|
214
|
+
|
215
|
+
# it { subject.must_equal([]) }
|
216
|
+
# end
|
217
|
+
|
218
|
+
# context 'when there is content on the front buffer' do
|
219
|
+
# let(:buffer) { :front }
|
220
|
+
# let(:front) {
|
221
|
+
# Vedeu.interface 'buffer' do
|
222
|
+
# lines do
|
223
|
+
# line 'front'
|
224
|
+
# end
|
225
|
+
# end
|
226
|
+
# }
|
227
|
+
|
228
|
+
# it { subject.must_equal([front]) }
|
229
|
+
# end
|
230
|
+
|
231
|
+
# context 'when there is no content on the front buffer' do
|
232
|
+
# let(:buffer) { :front }
|
233
|
+
|
234
|
+
# it { subject.must_equal([]) }
|
235
|
+
# end
|
236
|
+
|
237
|
+
# context 'when there is content on the previous buffer' do
|
238
|
+
# let(:buffer) { :previous }
|
239
|
+
# let(:previous) {
|
240
|
+
# Vedeu.interface 'buffer' do
|
241
|
+
# lines do
|
242
|
+
# line 'old_back'
|
243
|
+
# end
|
244
|
+
# end
|
245
|
+
# }
|
246
|
+
|
247
|
+
# it { subject.must_equal([previous]) }
|
248
|
+
# end
|
249
|
+
|
250
|
+
# context 'when there is no content on the previous buffer' do
|
251
|
+
# let(:buffer) { :previous }
|
252
|
+
|
253
|
+
# it { subject.must_equal([]) }
|
254
|
+
# end
|
255
|
+
end
|
190
256
|
|
191
257
|
end # Buffer
|
192
258
|
|
@@ -12,16 +12,6 @@ module Vedeu
|
|
12
12
|
before { Configuration.reset! }
|
13
13
|
after { test_configuration }
|
14
14
|
|
15
|
-
describe 'alias_methods' do
|
16
|
-
it { instance.must_respond_to(:interactive) }
|
17
|
-
it { instance.must_respond_to(:standalone) }
|
18
|
-
it { instance.must_respond_to(:run_once) }
|
19
|
-
it { instance.must_respond_to(:drb) }
|
20
|
-
it { instance.must_respond_to(:cooked) }
|
21
|
-
it { instance.must_respond_to(:raw) }
|
22
|
-
it { instance.must_respond_to(:debug) }
|
23
|
-
end
|
24
|
-
|
25
15
|
describe '.configure' do
|
26
16
|
it 'returns the configuration singleton' do
|
27
17
|
Vedeu.configure do
|
@@ -31,6 +21,8 @@ module Vedeu
|
|
31
21
|
end
|
32
22
|
|
33
23
|
describe '#interactive!' do
|
24
|
+
it { instance.must_respond_to(:interactive) }
|
25
|
+
|
34
26
|
it 'sets the option to the desired value' do
|
35
27
|
configuration = Vedeu.configure { interactive! }
|
36
28
|
configuration.interactive?.must_equal(true)
|
@@ -53,6 +45,8 @@ module Vedeu
|
|
53
45
|
end
|
54
46
|
|
55
47
|
describe '#standalone!' do
|
48
|
+
it { instance.must_respond_to(:standalone) }
|
49
|
+
|
56
50
|
it 'sets the option to the desired value' do
|
57
51
|
configuration = Vedeu.configure { standalone! }
|
58
52
|
configuration.interactive?.must_equal(false)
|
@@ -75,6 +69,8 @@ module Vedeu
|
|
75
69
|
end
|
76
70
|
|
77
71
|
describe '#run_once!' do
|
72
|
+
it { instance.must_respond_to(:run_once) }
|
73
|
+
|
78
74
|
it 'sets the option to the desired value' do
|
79
75
|
configuration = Vedeu.configure { run_once! }
|
80
76
|
configuration.once.must_equal(true)
|
@@ -97,6 +93,8 @@ module Vedeu
|
|
97
93
|
end
|
98
94
|
|
99
95
|
describe '#drb!' do
|
96
|
+
it { instance.must_respond_to(:drb) }
|
97
|
+
|
100
98
|
it 'sets the option to the desired value' do
|
101
99
|
configuration = Vedeu.configure { drb! }
|
102
100
|
configuration.drb.must_equal(true)
|
@@ -147,6 +145,8 @@ module Vedeu
|
|
147
145
|
end
|
148
146
|
|
149
147
|
describe '#cooked!' do
|
148
|
+
it { instance.must_respond_to(:cooked) }
|
149
|
+
|
150
150
|
it 'sets the option to the desired value' do
|
151
151
|
configuration = Vedeu.configure { cooked! }
|
152
152
|
configuration.terminal_mode.must_equal(:cooked)
|
@@ -156,12 +156,16 @@ module Vedeu
|
|
156
156
|
describe '#raw!' do
|
157
157
|
subject { Vedeu.configure { raw! } }
|
158
158
|
|
159
|
+
it { instance.must_respond_to(:raw) }
|
160
|
+
|
159
161
|
it 'sets the option to the desired value' do
|
160
162
|
subject.terminal_mode.must_equal(:raw)
|
161
163
|
end
|
162
164
|
end
|
163
165
|
|
164
166
|
describe '#debug!' do
|
167
|
+
it { instance.must_respond_to(:debug) }
|
168
|
+
|
165
169
|
it 'sets the option to the desired value' do
|
166
170
|
configuration = Vedeu.configure { debug! }
|
167
171
|
configuration.debug.must_equal(true)
|
@@ -210,6 +214,28 @@ module Vedeu
|
|
210
214
|
end
|
211
215
|
end
|
212
216
|
|
217
|
+
describe '#renderer' do
|
218
|
+
it { instance.must_respond_to(:renderers) }
|
219
|
+
end
|
220
|
+
|
221
|
+
describe '#stdin' do
|
222
|
+
let(:io) {}
|
223
|
+
|
224
|
+
subject { instance.stdin(io) }
|
225
|
+
end
|
226
|
+
|
227
|
+
describe '#stdout' do
|
228
|
+
let(:io) {}
|
229
|
+
|
230
|
+
subject { instance.stdout(io) }
|
231
|
+
end
|
232
|
+
|
233
|
+
describe '#stderr' do
|
234
|
+
let(:io) {}
|
235
|
+
|
236
|
+
subject { instance.stderr(io) }
|
237
|
+
end
|
238
|
+
|
213
239
|
describe 'redefining system keys' do
|
214
240
|
methods_and_keys = {
|
215
241
|
exit_key: :exit,
|
@@ -55,33 +55,33 @@ module Vedeu
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
58
|
+
describe '#drb_height' do
|
59
|
+
it '--drb-height' do
|
60
|
+
Configuration.configure(['--drb-height'])
|
61
|
+
Configuration.drb_height.must_equal(true)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
describe '#drb_host' do
|
66
|
+
it '--drb-host' do
|
67
|
+
Configuration.configure(['--drb-host'])
|
68
|
+
Configuration.drb_host.must_equal(true)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
describe '#drb_port' do
|
73
|
+
it '--drb-port' do
|
74
|
+
Configuration.configure(['--drb-port'])
|
75
|
+
Configuration.drb_port.must_equal(true)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
describe '#drb_width' do
|
80
|
+
it '--drb-width' do
|
81
|
+
Configuration.configure(['--drb-width'])
|
82
|
+
Configuration.drb_width.must_equal(true)
|
83
|
+
end
|
84
|
+
end
|
85
85
|
|
86
86
|
describe '#interactive?' do
|
87
87
|
it '--interactive' do
|
@@ -9,13 +9,6 @@ module Vedeu
|
|
9
9
|
before { Configuration.reset! }
|
10
10
|
after { test_configuration }
|
11
11
|
|
12
|
-
describe 'alias_methods' do
|
13
|
-
it { described.must_respond_to(:debug) }
|
14
|
-
it { described.must_respond_to(:drb) }
|
15
|
-
it { described.must_respond_to(:interactive) }
|
16
|
-
it { described.must_respond_to(:once) }
|
17
|
-
end
|
18
|
-
|
19
12
|
describe '.default_system_keys' do
|
20
13
|
it 'returns the default system keys' do
|
21
14
|
Configuration.default_system_keys.must_equal(exit: 'q',
|
@@ -26,24 +19,32 @@ module Vedeu
|
|
26
19
|
end
|
27
20
|
|
28
21
|
describe '#debug?' do
|
22
|
+
it { described.must_respond_to(:debug) }
|
23
|
+
|
29
24
|
it 'returns the value of the debug option' do
|
30
25
|
Configuration.debug?.must_equal(false)
|
31
26
|
end
|
32
27
|
end
|
33
28
|
|
34
29
|
describe '#drb?' do
|
30
|
+
it { described.must_respond_to(:drb) }
|
31
|
+
|
35
32
|
it 'returns the value of the drb option' do
|
36
33
|
Configuration.drb?.must_equal(false)
|
37
34
|
end
|
38
35
|
end
|
39
36
|
|
40
37
|
describe '#interactive?' do
|
38
|
+
it { described.must_respond_to(:interactive) }
|
39
|
+
|
41
40
|
it 'returns the value of the interactive option' do
|
42
41
|
Configuration.interactive?.must_equal(true)
|
43
42
|
end
|
44
43
|
end
|
45
44
|
|
46
45
|
describe '#once?' do
|
46
|
+
it { described.must_respond_to(:once) }
|
47
|
+
|
47
48
|
it 'returns the value of the once option' do
|
48
49
|
Configuration.once?.must_equal(false)
|
49
50
|
end
|
@@ -39,6 +39,39 @@ module Vedeu
|
|
39
39
|
it { subject.instance_variable_get('@y').must_equal(8) }
|
40
40
|
end
|
41
41
|
|
42
|
+
describe '#attributes' do
|
43
|
+
it { instance.must_respond_to(:attributes) }
|
44
|
+
end
|
45
|
+
|
46
|
+
describe '#name' do
|
47
|
+
it { instance.must_respond_to(:name) }
|
48
|
+
end
|
49
|
+
|
50
|
+
describe '#ox' do
|
51
|
+
it { instance.must_respond_to(:ox) }
|
52
|
+
end
|
53
|
+
|
54
|
+
describe '#oy' do
|
55
|
+
it { instance.must_respond_to(:oy) }
|
56
|
+
end
|
57
|
+
|
58
|
+
describe '#state' do
|
59
|
+
it { instance.must_respond_to(:state) }
|
60
|
+
end
|
61
|
+
|
62
|
+
describe '#visible' do
|
63
|
+
it { instance.must_respond_to(:visible) }
|
64
|
+
it { instance.must_respond_to(:visible?) }
|
65
|
+
end
|
66
|
+
|
67
|
+
describe '#x' do
|
68
|
+
it { instance.must_respond_to(:x) }
|
69
|
+
end
|
70
|
+
|
71
|
+
describe '#y' do
|
72
|
+
it { instance.must_respond_to(:y) }
|
73
|
+
end
|
74
|
+
|
42
75
|
describe '#hide_cursor' do
|
43
76
|
subject { instance.hide_cursor }
|
44
77
|
|
@@ -67,6 +100,7 @@ module Vedeu
|
|
67
100
|
|
68
101
|
subject { instance.to_s }
|
69
102
|
|
103
|
+
it { instance.must_respond_to(:to_str) }
|
70
104
|
it { subject.must_be_instance_of(String) }
|
71
105
|
|
72
106
|
context 'when the cursor is visible' do
|
@@ -211,7 +211,7 @@ module Vedeu
|
|
211
211
|
end
|
212
212
|
end
|
213
213
|
|
214
|
-
describe '
|
214
|
+
describe '.origin' do
|
215
215
|
let(:_name) { 'move_origin' }
|
216
216
|
|
217
217
|
subject { described.origin(entity, _name) }
|
@@ -243,7 +243,37 @@ module Vedeu
|
|
243
243
|
|
244
244
|
subject { instance.move }
|
245
245
|
|
246
|
-
|
246
|
+
context 'when the entity is a Vedeu::Geometry' do
|
247
|
+
let(:entity) { Vedeu::Geometry }
|
248
|
+
end
|
249
|
+
|
250
|
+
context 'when the entity is a Vedeu::Cursor' do
|
251
|
+
it { subject.must_be_instance_of(Vedeu::Cursor) }
|
252
|
+
end
|
253
|
+
end
|
254
|
+
|
255
|
+
describe '#refresh' do
|
256
|
+
subject { instance.refresh }
|
257
|
+
|
258
|
+
context 'when the entity is a Vedeu::Geometry' do
|
259
|
+
let(:entity) { Vedeu::Geometry }
|
260
|
+
end
|
261
|
+
|
262
|
+
context 'when the entity is a Vedeu::Cursor' do
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
266
|
+
describe '#merged_attributes' do
|
267
|
+
subject { instance.merged_attributes }
|
268
|
+
|
269
|
+
context 'when the entity is a Vedeu::Geometry' do
|
270
|
+
let(:entity) { Vedeu::Geometry }
|
271
|
+
|
272
|
+
it { subject.must_be_instance_of(Hash) }
|
273
|
+
end
|
274
|
+
|
275
|
+
context 'when the entity is a Vedeu::Cursor' do
|
276
|
+
end
|
247
277
|
end
|
248
278
|
|
249
279
|
end # Move
|
@@ -16,11 +16,6 @@ module Vedeu
|
|
16
16
|
DRbObject.stubs(:new_with_uri).returns(server)
|
17
17
|
end
|
18
18
|
|
19
|
-
describe 'alias methods' do
|
20
|
-
it { instance.must_respond_to(:read) }
|
21
|
-
it { instance.must_respond_to(:write) }
|
22
|
-
end
|
23
|
-
|
24
19
|
describe '#initialize' do
|
25
20
|
it { instance.must_be_instance_of(described) }
|
26
21
|
it { instance.instance_variable_get('@uri').must_equal(uri) }
|
@@ -49,6 +44,7 @@ module Vedeu
|
|
49
44
|
let(:data) {}
|
50
45
|
|
51
46
|
subject { instance.input(data) }
|
47
|
+
it { instance.must_respond_to(:read) }
|
52
48
|
|
53
49
|
context 'when the DRb server is not available or not enabled' do
|
54
50
|
before { DRbObject.stubs(:new_with_uri).raises(DRb::DRbConnError) }
|
@@ -63,6 +59,8 @@ module Vedeu
|
|
63
59
|
describe '#output' do
|
64
60
|
subject { instance.output }
|
65
61
|
|
62
|
+
it { instance.must_respond_to(:write) }
|
63
|
+
|
66
64
|
context 'when the DRb server is not available or not enabled' do
|
67
65
|
before { DRbObject.stubs(:new_with_uri).raises(DRb::DRbConnError) }
|
68
66
|
|
@@ -17,11 +17,6 @@ module Vedeu
|
|
17
17
|
DRb.stubs(:thread).returns(running)
|
18
18
|
end
|
19
19
|
|
20
|
-
describe 'alias_methods' do
|
21
|
-
it { instance.must_respond_to(:read) }
|
22
|
-
it { instance.must_respond_to(:write) }
|
23
|
-
end
|
24
|
-
|
25
20
|
describe '.input' do
|
26
21
|
let(:data) {}
|
27
22
|
let(:type) { :keypress }
|
@@ -37,15 +32,6 @@ module Vedeu
|
|
37
32
|
it { Vedeu.expects(:trigger).with(:_drb_retrieve_output_); subject }
|
38
33
|
end
|
39
34
|
|
40
|
-
describe '#pid' do
|
41
|
-
before { Process.stubs(:pid).returns(9876) }
|
42
|
-
|
43
|
-
subject { instance.pid }
|
44
|
-
|
45
|
-
it { subject.must_be_instance_of(Fixnum) }
|
46
|
-
it { subject.must_equal(9876) }
|
47
|
-
end
|
48
|
-
|
49
35
|
describe '.restart' do
|
50
36
|
subject { described.restart }
|
51
37
|
|
@@ -156,6 +142,43 @@ module Vedeu
|
|
156
142
|
end
|
157
143
|
end
|
158
144
|
|
145
|
+
describe '#input' do
|
146
|
+
it { instance.must_respond_to(:read) }
|
147
|
+
end
|
148
|
+
|
149
|
+
describe '#output' do
|
150
|
+
it { instance.must_respond_to(:write) }
|
151
|
+
end
|
152
|
+
|
153
|
+
describe '#pid' do
|
154
|
+
before { Process.stubs(:pid).returns(9876) }
|
155
|
+
|
156
|
+
subject { instance.pid }
|
157
|
+
|
158
|
+
it { subject.must_be_instance_of(Fixnum) }
|
159
|
+
it { subject.must_equal(9876) }
|
160
|
+
end
|
161
|
+
|
162
|
+
describe '#restart' do
|
163
|
+
it { instance.must_respond_to(:restart) }
|
164
|
+
end
|
165
|
+
|
166
|
+
describe '#shutdown' do
|
167
|
+
it { instance.must_respond_to(:shutdown) }
|
168
|
+
end
|
169
|
+
|
170
|
+
describe '#start' do
|
171
|
+
it { instance.must_respond_to(:start) }
|
172
|
+
end
|
173
|
+
|
174
|
+
describe '#status' do
|
175
|
+
it { instance.must_respond_to(:status) }
|
176
|
+
end
|
177
|
+
|
178
|
+
describe '#stop' do
|
179
|
+
it { instance.must_respond_to(:stop) }
|
180
|
+
end
|
181
|
+
|
159
182
|
end # Server
|
160
183
|
|
161
184
|
end # Distributed
|