vedeu 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/vedeu_drb_client +6 -0
- data/lib/vedeu/all.rb +1 -0
- data/lib/vedeu/application.rb +24 -1
- data/lib/vedeu/configuration/api.rb +107 -0
- data/lib/vedeu/configuration/cli.rb +34 -0
- data/lib/vedeu/configuration/configuration.rb +75 -4
- data/lib/vedeu/distributed/all.rb +8 -0
- data/lib/vedeu/distributed/application.rb +91 -0
- data/lib/vedeu/distributed/client.rb +58 -0
- data/lib/vedeu/distributed/subprocess.rb +111 -0
- data/lib/vedeu/distributed/templates/default_application.vedeu +34 -0
- data/lib/vedeu/distributed/templates/default_borders.vedeu +19 -0
- data/lib/vedeu/distributed/templates/default_configuration.vedeu +31 -0
- data/lib/vedeu/distributed/templates/default_events.vedeu +1 -0
- data/lib/vedeu/distributed/templates/default_geometries.vedeu +7 -0
- data/lib/vedeu/distributed/templates/default_interfaces.vedeu +4 -0
- data/lib/vedeu/distributed/templates/default_keymaps.vedeu +6 -0
- data/lib/vedeu/distributed/templates/default_menus.vedeu +3 -0
- data/lib/vedeu/distributed/templates/default_views.vedeu +14 -0
- data/lib/vedeu/distributed/test_application.rb +99 -0
- data/lib/vedeu/distributed/uri.rb +38 -0
- data/lib/vedeu/input/mapper.rb +10 -0
- data/lib/vedeu/launcher.rb +4 -0
- data/lib/vedeu/models/geometry.rb +16 -31
- data/lib/vedeu/models/view/char.rb +5 -5
- data/lib/vedeu/models/view/interface.rb +2 -1
- data/lib/vedeu/output/all.rb +2 -0
- data/lib/vedeu/output/output.rb +40 -0
- data/lib/vedeu/output/position_index.rb +24 -0
- data/lib/vedeu/output/virtual_terminal.rb +87 -0
- data/lib/vedeu/support/all.rb +1 -0
- data/lib/vedeu/support/limit.rb +33 -0
- data/lib/vedeu/support/position.rb +29 -0
- data/lib/vedeu/support/terminal.rb +14 -2
- data/test/integration/distributed_test.rb +14 -0
- data/test/lib/vedeu/application_test.rb +7 -6
- data/test/lib/vedeu/buffers/buffer_test.rb +6 -8
- data/test/lib/vedeu/configuration/api_test.rb +50 -0
- data/test/lib/vedeu/configuration/cli_test.rb +21 -0
- data/test/lib/vedeu/configuration/configuration_test.rb +24 -0
- data/test/lib/vedeu/cursor/move_cursor_test.rb +5 -7
- data/test/lib/vedeu/distributed/application_test.rb +24 -0
- data/test/lib/vedeu/distributed/client_test.rb +36 -0
- data/test/lib/vedeu/distributed/subprocess_test.rb +20 -0
- data/test/lib/vedeu/distributed/test_application_test.rb +26 -0
- data/test/lib/vedeu/distributed/uri_test.rb +73 -0
- data/test/lib/vedeu/dsl/components/border_test.rb +3 -5
- data/test/lib/vedeu/dsl/components/keymap_test.rb +2 -4
- data/test/lib/vedeu/dsl/components/menu_test.rb +2 -4
- data/test/lib/vedeu/dsl/composition_test.rb +3 -5
- data/test/lib/vedeu/dsl/interface_test.rb +3 -5
- data/test/lib/vedeu/dsl/line_test.rb +3 -5
- data/test/lib/vedeu/dsl/stream_test.rb +3 -5
- data/test/lib/vedeu/events/event_test.rb +8 -10
- data/test/lib/vedeu/events/trigger_test.rb +4 -6
- data/test/lib/vedeu/input/input_test.rb +2 -4
- data/test/lib/vedeu/input/key_test.rb +0 -2
- data/test/lib/vedeu/input/keymap_test.rb +4 -6
- data/test/lib/vedeu/input/mapper_test.rb +5 -7
- data/test/lib/vedeu/launcher_test.rb +7 -9
- data/test/lib/vedeu/models/collection_test.rb +4 -6
- data/test/lib/vedeu/models/geometry_test.rb +40 -13
- data/test/lib/vedeu/models/group_test.rb +4 -6
- data/test/lib/vedeu/models/menu_test.rb +6 -9
- data/test/lib/vedeu/models/view/char_test.rb +7 -9
- data/test/lib/vedeu/models/view/chars_test.rb +1 -3
- data/test/lib/vedeu/models/view/composition_test.rb +4 -6
- data/test/lib/vedeu/models/view/interface_test.rb +10 -12
- data/test/lib/vedeu/models/view/interfaces_test.rb +1 -3
- data/test/lib/vedeu/models/view/line_test.rb +5 -7
- data/test/lib/vedeu/models/view/lines_test.rb +1 -3
- data/test/lib/vedeu/models/view/stream_test.rb +6 -8
- data/test/lib/vedeu/models/view/streams_test.rb +1 -3
- data/test/lib/vedeu/output/border_test.rb +6 -8
- data/test/lib/vedeu/output/compositor_test.rb +2 -4
- data/test/lib/vedeu/output/output_test.rb +5 -4
- data/test/lib/vedeu/output/position_index_test.rb +72 -0
- data/test/lib/vedeu/output/viewport_test.rb +2 -4
- data/test/lib/vedeu/output/virtual_terminal_test.rb +120 -0
- data/test/lib/vedeu/output/wordwrap_test.rb +3 -5
- data/test/lib/vedeu/presentation/colour_test.rb +0 -2
- data/test/lib/vedeu/presentation/style_test.rb +2 -4
- data/test/lib/vedeu/presentation/translator_test.rb +2 -4
- data/test/lib/vedeu/repositories/repository_test.rb +3 -5
- data/test/lib/vedeu/support/console_test.rb +5 -7
- data/test/lib/vedeu/support/content_geometry_test.rb +2 -4
- data/test/lib/vedeu/support/coordinate_test.rb +5 -7
- data/test/lib/vedeu/support/grid_test.rb +2 -4
- data/test/lib/vedeu/support/limit_test.rb +30 -0
- data/test/lib/vedeu/support/position_test.rb +8 -4
- data/test/lib/vedeu/support/position_validator_test.rb +4 -6
- data/test/lib/vedeu/support/read_test.rb +3 -5
- data/test/lib/vedeu/support/sentence_test.rb +3 -4
- data/test/lib/vedeu/support/trace_test.rb +2 -4
- data/test/lib/vedeu/support/visible_test.rb +6 -8
- data/test/lib/vedeu/support/write_test.rb +3 -5
- data/test/test_helper.rb +6 -2
- data/vedeu.gemspec +1 -1
- metadata +40 -2
@@ -6,15 +6,16 @@ module Vedeu
|
|
6
6
|
|
7
7
|
let(:described) { Vedeu::Application }
|
8
8
|
let(:instance) { described.new(configuration) }
|
9
|
-
let(:configuration) { }
|
9
|
+
let(:configuration) { mock('Vedeu::Configuration') }
|
10
10
|
|
11
|
-
before
|
11
|
+
before do
|
12
|
+
configuration.stubs(:drb?).returns(false)
|
13
|
+
Terminal.stubs(:open).returns([''])
|
14
|
+
end
|
12
15
|
|
13
16
|
describe '#initialize' do
|
14
|
-
|
15
|
-
|
16
|
-
it { subject.must_be_instance_of(described) }
|
17
|
-
it { subject.instance_variable_get('@configuration').must_equal(configuration) }
|
17
|
+
it { instance.must_be_instance_of(described) }
|
18
|
+
it { instance.instance_variable_get('@configuration').must_equal(configuration) }
|
18
19
|
end
|
19
20
|
|
20
21
|
describe '.start' do
|
@@ -15,14 +15,12 @@ module Vedeu
|
|
15
15
|
before { Vedeu.stubs(:trigger) }
|
16
16
|
|
17
17
|
describe '#initialize' do
|
18
|
-
|
19
|
-
|
20
|
-
it {
|
21
|
-
it {
|
22
|
-
it {
|
23
|
-
it {
|
24
|
-
it { subject.instance_variable_get('@previous').must_equal(previous) }
|
25
|
-
it { subject.instance_variable_get('@repository').must_equal(Vedeu.buffers) }
|
18
|
+
it { instance.must_be_instance_of(described) }
|
19
|
+
it { instance.instance_variable_get('@name').must_equal(buffer_name) }
|
20
|
+
it { instance.instance_variable_get('@back').must_equal(back) }
|
21
|
+
it { instance.instance_variable_get('@front').must_equal(front) }
|
22
|
+
it { instance.instance_variable_get('@previous').must_equal(previous) }
|
23
|
+
it { instance.instance_variable_get('@repository').must_equal(Vedeu.buffers) }
|
26
24
|
end
|
27
25
|
|
28
26
|
describe '#inspect' do
|
@@ -83,6 +83,56 @@ module Vedeu
|
|
83
83
|
end
|
84
84
|
end
|
85
85
|
|
86
|
+
describe '#drb!' do
|
87
|
+
it 'sets the option to the desired value' do
|
88
|
+
configuration = Vedeu.configure { drb! }
|
89
|
+
configuration.drb.must_equal(true)
|
90
|
+
end
|
91
|
+
|
92
|
+
it 'sets the option to the desired value' do
|
93
|
+
configuration = Vedeu.configure { drb(false) }
|
94
|
+
configuration.drb.must_equal(false)
|
95
|
+
end
|
96
|
+
|
97
|
+
it 'sets the option to the desired value' do
|
98
|
+
configuration = Vedeu.configure { drb(true) }
|
99
|
+
configuration.drb.must_equal(true)
|
100
|
+
end
|
101
|
+
|
102
|
+
it 'sets the option to the desired value' do
|
103
|
+
configuration = Vedeu.configure { drb }
|
104
|
+
configuration.drb.must_equal(true)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
describe '#drb_host' do
|
109
|
+
it 'sets the options to the desired value' do
|
110
|
+
configuration = Vedeu.configure { drb_host('localhost') }
|
111
|
+
configuration.drb_host.must_equal('localhost')
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
describe '#drb_port' do
|
116
|
+
it 'sets the options to the desired value' do
|
117
|
+
configuration = Vedeu.configure { drb_port('12345') }
|
118
|
+
configuration.drb_port.must_equal('12345')
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
describe '#drb_height' do
|
123
|
+
it 'sets the options to the desired value' do
|
124
|
+
configuration = Vedeu.configure { drb_height(15) }
|
125
|
+
configuration.drb_height.must_equal(15)
|
126
|
+
end
|
127
|
+
end
|
128
|
+
|
129
|
+
describe '#drb_width' do
|
130
|
+
it 'sets the options to the desired value' do
|
131
|
+
configuration = Vedeu.configure { drb_width(40) }
|
132
|
+
configuration.drb_width.must_equal(40)
|
133
|
+
end
|
134
|
+
end
|
135
|
+
|
86
136
|
describe '#cooked!' do
|
87
137
|
it 'sets the option to the desired value' do
|
88
138
|
configuration = Vedeu.configure { cooked! }
|
@@ -47,6 +47,27 @@ module Vedeu
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
+
describe '#drb' do
|
51
|
+
it '--drb' do
|
52
|
+
Configuration.configure(['--drb'])
|
53
|
+
Configuration.drb?.must_equal(true)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# describe '#drb_host' do
|
58
|
+
# it '--drb-host' do
|
59
|
+
# Configuration.configure(['--drb-host', 'localhost'])
|
60
|
+
# Configuration.drb_host.must_equal('localhost')
|
61
|
+
# end
|
62
|
+
# end
|
63
|
+
|
64
|
+
# describe '#drb_port' do
|
65
|
+
# it '--drb-port' do
|
66
|
+
# Configuration.configure(['--drb-port', '12345'])
|
67
|
+
# Configuration.drb_port.must_equal('12345')
|
68
|
+
# end
|
69
|
+
# end
|
70
|
+
|
50
71
|
describe '#interactive?' do
|
51
72
|
it '--interactive' do
|
52
73
|
Configuration.configure(['--interactive'])
|
@@ -24,6 +24,12 @@ module Vedeu
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
+
describe '#drb?' do
|
28
|
+
it 'returns the value of the drb option' do
|
29
|
+
Configuration.drb?.must_equal(false)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
27
33
|
describe '#interactive?' do
|
28
34
|
it 'returns the value of the interactive option' do
|
29
35
|
Configuration.interactive?.must_equal(true)
|
@@ -36,6 +42,24 @@ module Vedeu
|
|
36
42
|
end
|
37
43
|
end
|
38
44
|
|
45
|
+
describe '#stdin' do
|
46
|
+
it 'returns the value of the redefined STDIN' do
|
47
|
+
Configuration.stdin.must_equal(nil)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
describe '#stdout' do
|
52
|
+
it 'returns the value of the redefined STDOUT' do
|
53
|
+
Configuration.stdout.must_equal(nil)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
describe '#stderr' do
|
58
|
+
it 'returns the value of the redefined STDERR' do
|
59
|
+
Configuration.stderr.must_equal(nil)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
39
63
|
describe '#terminal_mode' do
|
40
64
|
it 'returns the value of the mode option' do
|
41
65
|
Configuration.terminal_mode.must_equal(:raw)
|
@@ -49,13 +49,11 @@ module Vedeu
|
|
49
49
|
before { IO.console.stubs(:winsize).returns([25, 80]) }
|
50
50
|
|
51
51
|
describe '#initialize' do
|
52
|
-
|
53
|
-
|
54
|
-
it {
|
55
|
-
it {
|
56
|
-
it {
|
57
|
-
it { subject.instance_variable_get('@dy').must_equal(dy) }
|
58
|
-
it { subject.instance_variable_get('@dx').must_equal(dx) }
|
52
|
+
it { instance.must_be_instance_of(Vedeu::MoveCursor) }
|
53
|
+
it { instance.instance_variable_get('@cursor').must_equal(cursor) }
|
54
|
+
it { instance.instance_variable_get('@interface').must_equal(interface) }
|
55
|
+
it { instance.instance_variable_get('@dy').must_equal(dy) }
|
56
|
+
it { instance.instance_variable_get('@dx').must_equal(dx) }
|
59
57
|
end
|
60
58
|
|
61
59
|
describe '.down' do
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Vedeu
|
4
|
+
|
5
|
+
module Distributed
|
6
|
+
|
7
|
+
describe Application do
|
8
|
+
|
9
|
+
let(:described) { Vedeu::Distributed::Application }
|
10
|
+
let(:instance) { described.new(configuration) }
|
11
|
+
let(:configuration) {}
|
12
|
+
|
13
|
+
describe '#initialize' do
|
14
|
+
subject { instance }
|
15
|
+
|
16
|
+
it { subject.must_be_instance_of(Vedeu::Distributed::Application) }
|
17
|
+
it { subject.instance_variable_get('@configuration').must_equal(configuration) }
|
18
|
+
end
|
19
|
+
|
20
|
+
end # Application
|
21
|
+
|
22
|
+
end # Distributed
|
23
|
+
|
24
|
+
end # Vedeu
|
@@ -0,0 +1,36 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Vedeu
|
4
|
+
|
5
|
+
module Distributed
|
6
|
+
|
7
|
+
describe Client do
|
8
|
+
|
9
|
+
let(:described) { Vedeu::Distributed::Client }
|
10
|
+
let(:instance) { described.new(uri) }
|
11
|
+
let(:uri) {}
|
12
|
+
|
13
|
+
describe '#initialize' do
|
14
|
+
subject { instance }
|
15
|
+
|
16
|
+
it { subject.must_be_instance_of(described) }
|
17
|
+
it { subject.instance_variable_get('@uri').must_equal('') }
|
18
|
+
end
|
19
|
+
|
20
|
+
describe '#input' do
|
21
|
+
end
|
22
|
+
|
23
|
+
describe '#output' do
|
24
|
+
end
|
25
|
+
|
26
|
+
describe '#start' do
|
27
|
+
end
|
28
|
+
|
29
|
+
describe '#stop' do
|
30
|
+
end
|
31
|
+
|
32
|
+
end # Client
|
33
|
+
|
34
|
+
end # Distributed
|
35
|
+
|
36
|
+
end # Vedeu
|
@@ -0,0 +1,20 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Vedeu
|
4
|
+
|
5
|
+
describe Subprocess do
|
6
|
+
|
7
|
+
let(:described) { Vedeu::Subprocess }
|
8
|
+
let(:instance) { described.new(application) }
|
9
|
+
let(:application) {}
|
10
|
+
|
11
|
+
describe '#initialize' do
|
12
|
+
subject { instance }
|
13
|
+
|
14
|
+
it { subject.must_be_instance_of(Vedeu::Subprocess) }
|
15
|
+
it { subject.instance_variable_get('@application').must_equal(application) }
|
16
|
+
end
|
17
|
+
|
18
|
+
end # Subprocess
|
19
|
+
|
20
|
+
end # Vedeu
|
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Vedeu
|
4
|
+
|
5
|
+
describe TestApplication do
|
6
|
+
|
7
|
+
let(:described) { Vedeu::TestApplication }
|
8
|
+
let(:instance) { described.new(attributes) }
|
9
|
+
let(:attributes) { {} }
|
10
|
+
|
11
|
+
describe '#initialize' do
|
12
|
+
subject { instance }
|
13
|
+
|
14
|
+
it { subject.must_be_instance_of(Vedeu::TestApplication) }
|
15
|
+
# it { subject.instance_variable_get('@attributes').must_equal(attributes) }
|
16
|
+
end
|
17
|
+
|
18
|
+
describe '#lib_dir' do
|
19
|
+
subject { instance.lib_dir }
|
20
|
+
|
21
|
+
it { subject.must_be_instance_of(String) }
|
22
|
+
end
|
23
|
+
|
24
|
+
end # TestApplication
|
25
|
+
|
26
|
+
end # Vedeu
|
@@ -0,0 +1,73 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Vedeu
|
4
|
+
|
5
|
+
module Distributed
|
6
|
+
|
7
|
+
describe Uri do
|
8
|
+
|
9
|
+
let(:described) { Vedeu::Distributed::Uri }
|
10
|
+
let(:instance) { described.new(host, port) }
|
11
|
+
let(:host) {}
|
12
|
+
let(:port) {}
|
13
|
+
|
14
|
+
describe '#initialize' do
|
15
|
+
subject { instance }
|
16
|
+
|
17
|
+
it { subject.must_be_instance_of(described) }
|
18
|
+
it { subject.instance_variable_get('@host').must_equal('localhost') }
|
19
|
+
it { subject.instance_variable_get('@port').must_equal(21420) }
|
20
|
+
end
|
21
|
+
|
22
|
+
describe '#host' do
|
23
|
+
subject { instance.host }
|
24
|
+
|
25
|
+
context 'when the host has been defined by the client application' do
|
26
|
+
let(:host) { 'myserver' }
|
27
|
+
|
28
|
+
it 'returns the host' do
|
29
|
+
subject.must_equal('myserver')
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
context 'when the host has not been redefined' do
|
34
|
+
it 'returns the default host' do
|
35
|
+
subject.must_equal('localhost')
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe '#port' do
|
41
|
+
subject { instance.port }
|
42
|
+
|
43
|
+
context 'when the port has been defined by the client application' do
|
44
|
+
let(:port) { 40000 }
|
45
|
+
|
46
|
+
it 'returns the port' do
|
47
|
+
subject.must_equal(40000)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
context 'when the port has not been redefined' do
|
52
|
+
it 'returns the default port' do
|
53
|
+
subject.must_equal(21420)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
describe '#to_s' do
|
59
|
+
let(:host) { 'myserver' }
|
60
|
+
let(:port) { 40000 }
|
61
|
+
|
62
|
+
subject { instance.to_s }
|
63
|
+
|
64
|
+
it 'returns a single value for the uri' do
|
65
|
+
subject.must_equal('druby://myserver:40000')
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
end # Uri
|
70
|
+
|
71
|
+
end # Distributed
|
72
|
+
|
73
|
+
end # Vedeu
|
@@ -29,11 +29,9 @@ module Vedeu
|
|
29
29
|
end
|
30
30
|
|
31
31
|
describe '#initialize' do
|
32
|
-
|
33
|
-
|
34
|
-
it {
|
35
|
-
it { subject.instance_variable_get('@model').must_equal(model) }
|
36
|
-
it { subject.instance_variable_get('@client').must_equal(client) }
|
32
|
+
it { instance.must_be_instance_of(Vedeu::DSL::Border) }
|
33
|
+
it { instance.instance_variable_get('@model').must_equal(model) }
|
34
|
+
it { instance.instance_variable_get('@client').must_equal(client) }
|
37
35
|
end
|
38
36
|
|
39
37
|
describe '#bottom_left' do
|
@@ -11,10 +11,8 @@ module Vedeu
|
|
11
11
|
let(:model) { Vedeu::Keymap.new('_test_') }
|
12
12
|
|
13
13
|
describe '#initialize' do
|
14
|
-
|
15
|
-
|
16
|
-
it { subject.must_be_instance_of(described) }
|
17
|
-
it { subject.instance_variable_get('@model').must_equal(model) }
|
14
|
+
it { instance.must_be_instance_of(described) }
|
15
|
+
it { instance.instance_variable_get('@model').must_equal(model) }
|
18
16
|
end
|
19
17
|
|
20
18
|
describe '#key' do
|
@@ -40,10 +40,8 @@ module Vedeu
|
|
40
40
|
# end
|
41
41
|
|
42
42
|
describe '#initialize' do
|
43
|
-
|
44
|
-
|
45
|
-
it { subject.must_be_instance_of(Vedeu::DSL::Menu) }
|
46
|
-
it { subject.instance_variable_get('@model').must_equal(model) }
|
43
|
+
it { instance.must_be_instance_of(Vedeu::DSL::Menu) }
|
44
|
+
it { instance.instance_variable_get('@model').must_equal(model) }
|
47
45
|
end
|
48
46
|
|
49
47
|
# describe '.define' do
|
@@ -12,11 +12,9 @@ module Vedeu
|
|
12
12
|
let(:client) {}
|
13
13
|
|
14
14
|
describe '#initialize' do
|
15
|
-
|
16
|
-
|
17
|
-
it {
|
18
|
-
it { subject.instance_variable_get('@model').must_equal(model) }
|
19
|
-
it { subject.instance_variable_get('@client').must_equal(client) }
|
15
|
+
it { instance.must_be_instance_of(Vedeu::DSL::Composition) }
|
16
|
+
it { instance.instance_variable_get('@model').must_equal(model) }
|
17
|
+
it { instance.instance_variable_get('@client').must_equal(client) }
|
20
18
|
end
|
21
19
|
|
22
20
|
describe '#view' do
|
@@ -18,11 +18,9 @@ module Vedeu
|
|
18
18
|
before { Vedeu.interfaces.reset }
|
19
19
|
|
20
20
|
describe '#initialize' do
|
21
|
-
|
22
|
-
|
23
|
-
it {
|
24
|
-
it { subject.instance_variable_get('@model').must_equal(model) }
|
25
|
-
it { subject.instance_variable_get('@client').must_equal(client) }
|
21
|
+
it { instance.must_be_instance_of(Vedeu::DSL::Interface) }
|
22
|
+
it { instance.instance_variable_get('@model').must_equal(model) }
|
23
|
+
it { instance.instance_variable_get('@client').must_equal(client) }
|
26
24
|
end
|
27
25
|
|
28
26
|
describe '#border' do
|
@@ -24,11 +24,9 @@ module Vedeu
|
|
24
24
|
let(:style) { Vedeu::Style.new }
|
25
25
|
|
26
26
|
describe '#initialize' do
|
27
|
-
|
28
|
-
|
29
|
-
it {
|
30
|
-
it { subject.instance_variable_get('@model').must_equal(model) }
|
31
|
-
it { subject.instance_variable_get('@client').must_equal(client) }
|
27
|
+
it { instance.must_be_instance_of(described) }
|
28
|
+
it { instance.instance_variable_get('@model').must_equal(model) }
|
29
|
+
it { instance.instance_variable_get('@client').must_equal(client) }
|
32
30
|
end
|
33
31
|
|
34
32
|
describe '#line' do
|
@@ -12,11 +12,9 @@ module Vedeu
|
|
12
12
|
let(:client) {}
|
13
13
|
|
14
14
|
describe '#initialize' do
|
15
|
-
|
16
|
-
|
17
|
-
it {
|
18
|
-
it { subject.instance_variable_get('@model').must_equal(model) }
|
19
|
-
it { subject.instance_variable_get('@client').must_equal(client) }
|
15
|
+
it { instance.must_be_instance_of(Vedeu::DSL::Stream) }
|
16
|
+
it { instance.instance_variable_get('@model').must_equal(model) }
|
17
|
+
it { instance.instance_variable_get('@client').must_equal(client) }
|
20
18
|
end
|
21
19
|
|
22
20
|
end # Stream
|
@@ -17,16 +17,14 @@ module Vedeu
|
|
17
17
|
end
|
18
18
|
|
19
19
|
describe '#initialize' do
|
20
|
-
|
21
|
-
|
22
|
-
it {
|
23
|
-
it {
|
24
|
-
it {
|
25
|
-
|
26
|
-
it {
|
27
|
-
it {
|
28
|
-
it { subject.instance_variable_get('@now').must_equal(0) }
|
29
|
-
it { subject.instance_variable_get('@repository').must_equal(Vedeu.events) }
|
20
|
+
it { instance.must_be_instance_of(Event) }
|
21
|
+
it { instance.instance_variable_get('@name').must_equal(event_name) }
|
22
|
+
it { instance.instance_variable_get('@options').must_equal(options) }
|
23
|
+
# it { instance.instance_variable_get('@closure').must_equal(closure) }
|
24
|
+
it { instance.instance_variable_get('@deadline').must_equal(0) }
|
25
|
+
it { instance.instance_variable_get('@executed_at').must_equal(0) }
|
26
|
+
it { instance.instance_variable_get('@now').must_equal(0) }
|
27
|
+
it { instance.instance_variable_get('@repository').must_equal(Vedeu.events) }
|
30
28
|
end
|
31
29
|
|
32
30
|
describe '#bind' do
|
@@ -18,12 +18,10 @@ module Vedeu
|
|
18
18
|
end
|
19
19
|
|
20
20
|
describe '#initialize' do
|
21
|
-
|
22
|
-
|
23
|
-
it {
|
24
|
-
it {
|
25
|
-
it { subject.instance_variable_get('@args').must_equal([args]) }
|
26
|
-
it { subject.instance_variable_get('@repository').must_equal(Vedeu.events) }
|
21
|
+
it { instance.must_be_instance_of(Vedeu::Trigger) }
|
22
|
+
it { instance.instance_variable_get('@name').must_equal(event_name) }
|
23
|
+
it { instance.instance_variable_get('@args').must_equal([args]) }
|
24
|
+
it { instance.instance_variable_get('@repository').must_equal(Vedeu.events) }
|
27
25
|
end
|
28
26
|
|
29
27
|
describe '#trigger' do
|
@@ -12,10 +12,8 @@ module Vedeu
|
|
12
12
|
before { reader.stubs(:read).returns(keypress) }
|
13
13
|
|
14
14
|
describe '#initialize' do
|
15
|
-
|
16
|
-
|
17
|
-
it { subject.must_be_instance_of(Input) }
|
18
|
-
it { subject.instance_variable_get('@reader').must_equal(reader) }
|
15
|
+
it { instance.must_be_instance_of(Input) }
|
16
|
+
it { instance.instance_variable_get('@reader').must_equal(reader) }
|
19
17
|
end
|
20
18
|
|
21
19
|
describe '.capture' do
|
@@ -11,12 +11,10 @@ module Vedeu
|
|
11
11
|
let(:key) { Vedeu::Key.new('a') { :output } }
|
12
12
|
|
13
13
|
describe '#initialize' do
|
14
|
-
|
15
|
-
|
16
|
-
it {
|
17
|
-
it {
|
18
|
-
it { subject.instance_variable_get('@keys').must_be_instance_of(Array) }
|
19
|
-
it { subject.instance_variable_get('@repository').must_equal(Vedeu.keymaps) }
|
14
|
+
it { instance.must_be_instance_of(Keymap) }
|
15
|
+
it { instance.instance_variable_get('@name').must_equal(map_name) }
|
16
|
+
it { instance.instance_variable_get('@keys').must_be_instance_of(Array) }
|
17
|
+
it { instance.instance_variable_get('@repository').must_equal(Vedeu.keymaps) }
|
20
18
|
end
|
21
19
|
|
22
20
|
describe '#add' do
|
@@ -15,17 +15,15 @@ module Vedeu
|
|
15
15
|
end
|
16
16
|
|
17
17
|
describe '#initialize' do
|
18
|
-
|
19
|
-
|
20
|
-
it {
|
21
|
-
it {
|
22
|
-
it { subject.instance_variable_get('@name').must_equal(keymap) }
|
23
|
-
it { subject.instance_variable_get('@repository').must_equal(Vedeu.keymaps) }
|
18
|
+
it { instance.must_be_instance_of(described) }
|
19
|
+
it { instance.instance_variable_get('@key').must_equal(key) }
|
20
|
+
it { instance.instance_variable_get('@name').must_equal(keymap) }
|
21
|
+
it { instance.instance_variable_get('@repository').must_equal(Vedeu.keymaps) }
|
24
22
|
|
25
23
|
context 'when the repository is provided' do
|
26
24
|
let(:repository) { Vedeu::Repository.new }
|
27
25
|
|
28
|
-
it {
|
26
|
+
it { instance.instance_variable_get('@repository').must_equal(repository) }
|
29
27
|
end
|
30
28
|
end
|
31
29
|
|
@@ -15,15 +15,13 @@ module Vedeu
|
|
15
15
|
end
|
16
16
|
|
17
17
|
describe '#initialize' do
|
18
|
-
|
19
|
-
|
20
|
-
it {
|
21
|
-
it {
|
22
|
-
it {
|
23
|
-
it {
|
24
|
-
it {
|
25
|
-
it { subject.instance_variable_get('@kernel').must_equal(Kernel) }
|
26
|
-
it { subject.instance_variable_get('@exit_code').must_equal(1) }
|
18
|
+
it { instance.must_be_instance_of(described) }
|
19
|
+
it { instance.instance_variable_get('@argv').must_equal([]) }
|
20
|
+
it { instance.instance_variable_get('@stdin').must_equal(STDIN) }
|
21
|
+
it { instance.instance_variable_get('@stdout').must_equal(STDOUT) }
|
22
|
+
it { instance.instance_variable_get('@stderr').must_equal(STDERR) }
|
23
|
+
it { instance.instance_variable_get('@kernel').must_equal(Kernel) }
|
24
|
+
it { instance.instance_variable_get('@exit_code').must_equal(1) }
|
27
25
|
end
|
28
26
|
|
29
27
|
describe '#execute!' do
|
@@ -13,12 +13,10 @@ module Vedeu
|
|
13
13
|
let(:parent) { Vedeu::ModelTestClass.new }
|
14
14
|
|
15
15
|
describe '#initialize' do
|
16
|
-
|
17
|
-
|
18
|
-
it {
|
19
|
-
it {
|
20
|
-
it { subject.instance_variable_get('@name').must_equal(model_name) }
|
21
|
-
it { subject.instance_variable_get('@parent').must_equal(parent) }
|
16
|
+
it { instance.must_be_instance_of(Collection) }
|
17
|
+
it { instance.instance_variable_get('@collection').must_equal([]) }
|
18
|
+
it { instance.instance_variable_get('@name').must_equal(model_name) }
|
19
|
+
it { instance.instance_variable_get('@parent').must_equal(parent) }
|
22
20
|
end
|
23
21
|
|
24
22
|
describe '#[]' do
|