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
@@ -18,6 +18,18 @@ module Vedeu
|
|
18
18
|
it { subject.instance_variable_get('@pid').must_equal(nil) }
|
19
19
|
end
|
20
20
|
|
21
|
+
describe '.execute!' do
|
22
|
+
it { described.must_respond_to(:execute!) }
|
23
|
+
end
|
24
|
+
|
25
|
+
describe '#execute!' do
|
26
|
+
it { instance.must_respond_to(:execute!) }
|
27
|
+
end
|
28
|
+
|
29
|
+
describe '#kill' do
|
30
|
+
it { instance.must_respond_to(:kill) }
|
31
|
+
end
|
32
|
+
|
21
33
|
end # Subprocess
|
22
34
|
|
23
35
|
end # Vedeu
|
@@ -30,19 +30,16 @@ module Vedeu
|
|
30
30
|
Vedeu.interfaces.reset
|
31
31
|
end
|
32
32
|
|
33
|
-
describe 'alias methods' do
|
34
|
-
it { instance.must_respond_to(:show_bottom) }
|
35
|
-
it { instance.must_respond_to(:show_left) }
|
36
|
-
it { instance.must_respond_to(:show_right) }
|
37
|
-
it { instance.must_respond_to(:show_top) }
|
38
|
-
end
|
39
|
-
|
40
33
|
describe '#initialize' do
|
41
34
|
it { instance.must_be_instance_of(described) }
|
42
35
|
it { instance.instance_variable_get('@model').must_equal(model) }
|
43
36
|
it { instance.instance_variable_get('@client').must_equal(client) }
|
44
37
|
end
|
45
38
|
|
39
|
+
describe '.border' do
|
40
|
+
it { described.must_respond_to(:border) }
|
41
|
+
end
|
42
|
+
|
46
43
|
describe '#bottom_left' do
|
47
44
|
let(:char) { 'C' }
|
48
45
|
|
@@ -73,6 +70,7 @@ module Vedeu
|
|
73
70
|
describe '#show_bottom' do
|
74
71
|
subject { instance.show_bottom(boolean) }
|
75
72
|
|
73
|
+
it { instance.must_respond_to(:bottom) }
|
76
74
|
it { subject.must_be_instance_of(TrueClass) }
|
77
75
|
|
78
76
|
context 'when false' do
|
@@ -12,18 +12,20 @@ module Vedeu
|
|
12
12
|
|
13
13
|
before { Terminal.stubs(:size).returns([25, 80]) }
|
14
14
|
|
15
|
-
describe 'alias methods' do
|
16
|
-
it { instance.must_respond_to(:centred!) }
|
17
|
-
end
|
18
|
-
|
19
15
|
describe '#initialize' do
|
20
16
|
it { instance.must_be_instance_of(described) }
|
21
17
|
it { instance.instance_variable_get('@model').must_equal(model) }
|
22
18
|
end
|
23
19
|
|
20
|
+
describe '.geometry' do
|
21
|
+
it { described.must_respond_to(:geometry) }
|
22
|
+
end
|
23
|
+
|
24
24
|
describe '#centred' do
|
25
25
|
subject { instance.centred(true) }
|
26
26
|
|
27
|
+
it { instance.must_respond_to(:centred!) }
|
28
|
+
|
27
29
|
it 'sets the attribute to the value' do
|
28
30
|
subject.must_equal(true)
|
29
31
|
end
|
@@ -23,10 +23,6 @@ module Vedeu
|
|
23
23
|
let(:colour) { Vedeu::Colour.new }
|
24
24
|
let(:style) { Vedeu::Style.new }
|
25
25
|
|
26
|
-
describe 'alias methods' do
|
27
|
-
it { instance.must_respond_to(:stream) }
|
28
|
-
end
|
29
|
-
|
30
26
|
describe '#initialize' do
|
31
27
|
it { instance.must_be_instance_of(described) }
|
32
28
|
it { instance.instance_variable_get('@model').must_equal(model) }
|
@@ -12,16 +12,12 @@ module Vedeu
|
|
12
12
|
let(:background) { '#00ff00' }
|
13
13
|
let(:foreground) { '#ff00ff' }
|
14
14
|
|
15
|
-
describe 'alias methods' do
|
16
|
-
it { instance.must_respond_to(:bg) }
|
17
|
-
it { instance.must_respond_to(:bgcolor) }
|
18
|
-
it { instance.must_respond_to(:fg) }
|
19
|
-
it { instance.must_respond_to(:fgcolor) }
|
20
|
-
end
|
21
|
-
|
22
15
|
describe '#background' do
|
23
16
|
subject { instance.background(background) }
|
24
17
|
|
18
|
+
it { instance.must_respond_to(:bg) }
|
19
|
+
it { instance.must_respond_to(:bgcolor) }
|
20
|
+
|
25
21
|
it { subject.must_be_instance_of(Vedeu::Colour) }
|
26
22
|
|
27
23
|
it 'sets the background' do
|
@@ -34,6 +30,9 @@ module Vedeu
|
|
34
30
|
describe '#foreground' do
|
35
31
|
subject { instance.foreground(foreground) }
|
36
32
|
|
33
|
+
it { instance.must_respond_to(:fg) }
|
34
|
+
it { instance.must_respond_to(:fgcolor) }
|
35
|
+
|
37
36
|
it { subject.must_be_instance_of(Vedeu::Colour) }
|
38
37
|
|
39
38
|
it 'sets the foreground' do
|
@@ -66,6 +65,8 @@ module Vedeu
|
|
66
65
|
|
67
66
|
subject { instance.style(args) }
|
68
67
|
|
68
|
+
it { instance.must_respond_to(:styles) }
|
69
|
+
|
69
70
|
it { subject.must_be_instance_of(Vedeu::Style) }
|
70
71
|
end
|
71
72
|
|
@@ -10,18 +10,18 @@ module Vedeu
|
|
10
10
|
let(:options) { {} }
|
11
11
|
let(:closure) { proc { :event_triggered } }
|
12
12
|
|
13
|
-
describe 'alias methods' do
|
14
|
-
it { described.must_respond_to(:event) }
|
15
|
-
it { described.must_respond_to(:register) }
|
16
|
-
it { described.must_respond_to(:unevent) }
|
17
|
-
end
|
18
|
-
|
19
13
|
describe '.bind' do
|
20
14
|
subject { described.bind(event_name, options) { :event_triggered } }
|
21
15
|
|
16
|
+
it { described.must_respond_to(:event) }
|
17
|
+
it { described.must_respond_to(:register) }
|
22
18
|
it { subject.must_be_instance_of(TrueClass) }
|
23
19
|
end
|
24
20
|
|
21
|
+
describe '.unbind' do
|
22
|
+
it { described.must_respond_to(:unbind ) }
|
23
|
+
end
|
24
|
+
|
25
25
|
describe '#initialize' do
|
26
26
|
it { instance.must_be_instance_of(described) }
|
27
27
|
it { instance.instance_variable_get('@name').must_equal(event_name) }
|
@@ -51,6 +51,59 @@ module Vedeu
|
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
+
describe '#centred' do
|
55
|
+
it { instance.must_respond_to(:centred) }
|
56
|
+
end
|
57
|
+
|
58
|
+
describe '#centred=' do
|
59
|
+
it { instance.must_respond_to(:centred=) }
|
60
|
+
end
|
61
|
+
|
62
|
+
describe '#attributes' do
|
63
|
+
it { instance.must_respond_to(:attributes) }
|
64
|
+
end
|
65
|
+
|
66
|
+
describe '#name' do
|
67
|
+
it { instance.must_respond_to(:name) }
|
68
|
+
end
|
69
|
+
|
70
|
+
describe '#name=' do
|
71
|
+
it { instance.must_respond_to(:name=) }
|
72
|
+
end
|
73
|
+
|
74
|
+
describe '#height=' do
|
75
|
+
it { instance.must_respond_to(:height=) }
|
76
|
+
end
|
77
|
+
|
78
|
+
describe '#maximised' do
|
79
|
+
it { instance.must_respond_to(:maximised) }
|
80
|
+
it { instance.must_respond_to(:maximised?) }
|
81
|
+
end
|
82
|
+
|
83
|
+
describe '#maximised=' do
|
84
|
+
it { instance.must_respond_to(:maximised=) }
|
85
|
+
end
|
86
|
+
|
87
|
+
describe '#width=' do
|
88
|
+
it { instance.must_respond_to(:width=) }
|
89
|
+
end
|
90
|
+
|
91
|
+
describe '#x=' do
|
92
|
+
it { instance.must_respond_to(:x=) }
|
93
|
+
end
|
94
|
+
|
95
|
+
describe '#xn=' do
|
96
|
+
it { instance.must_respond_to(:xn=) }
|
97
|
+
end
|
98
|
+
|
99
|
+
describe '#y=' do
|
100
|
+
it { instance.must_respond_to(:y=) }
|
101
|
+
end
|
102
|
+
|
103
|
+
describe '#yn=' do
|
104
|
+
it { instance.must_respond_to(:yn=) }
|
105
|
+
end
|
106
|
+
|
54
107
|
describe '#inspect' do
|
55
108
|
subject { instance.inspect }
|
56
109
|
|
@@ -42,6 +42,30 @@ module Vedeu
|
|
42
42
|
it { instance.must_respond_to(:value) }
|
43
43
|
end
|
44
44
|
|
45
|
+
describe '#border' do
|
46
|
+
it { instance.must_respond_to(:border) }
|
47
|
+
end
|
48
|
+
|
49
|
+
describe '#border=' do
|
50
|
+
it { instance.must_respond_to(:border=) }
|
51
|
+
end
|
52
|
+
|
53
|
+
describe '#parent' do
|
54
|
+
it { instance.must_respond_to(:parent) }
|
55
|
+
end
|
56
|
+
|
57
|
+
describe '#parent=' do
|
58
|
+
it { instance.must_respond_to(:parent=) }
|
59
|
+
end
|
60
|
+
|
61
|
+
describe '#attributes' do
|
62
|
+
it { instance.must_respond_to(:attributes) }
|
63
|
+
end
|
64
|
+
|
65
|
+
describe '#value=' do
|
66
|
+
it { instance.must_respond_to(:value=) }
|
67
|
+
end
|
68
|
+
|
45
69
|
describe '#chars' do
|
46
70
|
subject { instance.chars }
|
47
71
|
|
@@ -47,6 +47,71 @@ module Vedeu
|
|
47
47
|
it { subject.instance_variable_get('@zindex').must_equal(zindex) }
|
48
48
|
end
|
49
49
|
|
50
|
+
describe '#client' do
|
51
|
+
it { instance.must_respond_to(:client) }
|
52
|
+
end
|
53
|
+
|
54
|
+
describe '#client=' do
|
55
|
+
it { instance.must_respond_to(:client=) }
|
56
|
+
end
|
57
|
+
|
58
|
+
describe '#delay' do
|
59
|
+
it { instance.must_respond_to(:delay) }
|
60
|
+
end
|
61
|
+
|
62
|
+
describe '#delay=' do
|
63
|
+
it { instance.must_respond_to(:delay=) }
|
64
|
+
end
|
65
|
+
|
66
|
+
describe '#group' do
|
67
|
+
it { instance.must_respond_to(:group) }
|
68
|
+
end
|
69
|
+
|
70
|
+
describe '#group=' do
|
71
|
+
it { instance.must_respond_to(:group=) }
|
72
|
+
end
|
73
|
+
|
74
|
+
describe '#name' do
|
75
|
+
it { instance.must_respond_to(:name) }
|
76
|
+
end
|
77
|
+
|
78
|
+
describe '#name=' do
|
79
|
+
it { instance.must_respond_to(:name=) }
|
80
|
+
end
|
81
|
+
|
82
|
+
describe '#parent' do
|
83
|
+
it { instance.must_respond_to(:parent) }
|
84
|
+
end
|
85
|
+
|
86
|
+
describe '#parent=' do
|
87
|
+
it { instance.must_respond_to(:parent=) }
|
88
|
+
end
|
89
|
+
|
90
|
+
describe '#zindex' do
|
91
|
+
it { instance.must_respond_to(:zindex) }
|
92
|
+
end
|
93
|
+
|
94
|
+
describe '#zindex=' do
|
95
|
+
it { instance.must_respond_to(:zindex=) }
|
96
|
+
end
|
97
|
+
|
98
|
+
describe '#visible' do
|
99
|
+
it { instance.must_respond_to(:visible) }
|
100
|
+
it { instance.must_respond_to(:visible?) }
|
101
|
+
end
|
102
|
+
|
103
|
+
describe '#visible=' do
|
104
|
+
it { instance.must_respond_to(:visible=) }
|
105
|
+
end
|
106
|
+
|
107
|
+
describe '#attributes' do
|
108
|
+
it { instance.must_respond_to(:attributes) }
|
109
|
+
end
|
110
|
+
|
111
|
+
describe '#lines=' do
|
112
|
+
it { instance.must_respond_to(:lines=) }
|
113
|
+
end
|
114
|
+
|
50
115
|
describe '#lines?' do
|
51
116
|
subject { instance.lines? }
|
52
117
|
|
@@ -50,6 +50,26 @@ module Vedeu
|
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
+
describe '#collection' do
|
54
|
+
it { instance.must_respond_to(:collection) }
|
55
|
+
end
|
56
|
+
|
57
|
+
describe '#collection=' do
|
58
|
+
it { instance.must_respond_to(:collection=) }
|
59
|
+
end
|
60
|
+
|
61
|
+
describe '#current=' do
|
62
|
+
it { instance.must_respond_to(:current=) }
|
63
|
+
end
|
64
|
+
|
65
|
+
describe '#name' do
|
66
|
+
it { instance.must_respond_to(:name) }
|
67
|
+
end
|
68
|
+
|
69
|
+
describe '#name=' do
|
70
|
+
it { instance.must_respond_to(:name=) }
|
71
|
+
end
|
72
|
+
|
53
73
|
describe '#current' do
|
54
74
|
subject { instance.current }
|
55
75
|
|
@@ -73,6 +93,10 @@ module Vedeu
|
|
73
93
|
end
|
74
94
|
end
|
75
95
|
|
96
|
+
describe '#selected=' do
|
97
|
+
it { instance.must_respond_to(:selected=) }
|
98
|
+
end
|
99
|
+
|
76
100
|
describe '#current_item' do
|
77
101
|
subject { instance.current_item }
|
78
102
|
|
@@ -36,6 +36,29 @@ module Vedeu
|
|
36
36
|
it { instance.instance_variable_get('@parent').must_equal(parent) }
|
37
37
|
end
|
38
38
|
|
39
|
+
describe '#parent' do
|
40
|
+
it { instance.must_respond_to(:parent) }
|
41
|
+
end
|
42
|
+
|
43
|
+
describe '#parent=' do
|
44
|
+
it { instance.must_respond_to(:parent=) }
|
45
|
+
end
|
46
|
+
|
47
|
+
describe '#value' do
|
48
|
+
it { instance.must_respond_to(:value) }
|
49
|
+
it { instance.must_respond_to(:content) }
|
50
|
+
it { instance.must_respond_to(:data) }
|
51
|
+
it { instance.must_respond_to(:text) }
|
52
|
+
end
|
53
|
+
|
54
|
+
describe '#value=' do
|
55
|
+
it { instance.must_respond_to(:value=) }
|
56
|
+
end
|
57
|
+
|
58
|
+
describe '#attributes' do
|
59
|
+
it { instance.must_respond_to(:attributes) }
|
60
|
+
end
|
61
|
+
|
39
62
|
describe '#add' do
|
40
63
|
let(:child) { instance }
|
41
64
|
|
@@ -20,6 +20,18 @@ module Vedeu
|
|
20
20
|
it { instance.instance_variable_get('@name').must_equal(_name) }
|
21
21
|
end
|
22
22
|
|
23
|
+
describe '#maximised' do
|
24
|
+
it { instance.must_respond_to(:maximised) }
|
25
|
+
end
|
26
|
+
|
27
|
+
describe '#maximised=' do
|
28
|
+
it { instance.must_respond_to(:maximised=) }
|
29
|
+
end
|
30
|
+
|
31
|
+
describe '#name' do
|
32
|
+
it { instance.must_respond_to(:name) }
|
33
|
+
end
|
34
|
+
|
23
35
|
describe '#centred' do
|
24
36
|
subject { instance.centred }
|
25
37
|
|
@@ -77,6 +77,115 @@ module Vedeu
|
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
80
|
+
describe '#attributes' do
|
81
|
+
it { instance.must_respond_to(:attributes) }
|
82
|
+
end
|
83
|
+
|
84
|
+
describe '#attributes=' do
|
85
|
+
it { instance.must_respond_to(:attributes=) }
|
86
|
+
end
|
87
|
+
|
88
|
+
describe '#bottom_left' do
|
89
|
+
it { instance.must_respond_to(:bottom_left) }
|
90
|
+
end
|
91
|
+
|
92
|
+
describe '#bottom_left=' do
|
93
|
+
it { instance.must_respond_to(:bottom_left=) }
|
94
|
+
end
|
95
|
+
|
96
|
+
describe '#bottom_right' do
|
97
|
+
it { instance.must_respond_to(:bottom_right) }
|
98
|
+
end
|
99
|
+
|
100
|
+
describe '#bottom_right=' do
|
101
|
+
it { instance.must_respond_to(:bottom_right=) }
|
102
|
+
end
|
103
|
+
|
104
|
+
describe '#horizontal' do
|
105
|
+
it { instance.must_respond_to(:horizontal) }
|
106
|
+
end
|
107
|
+
|
108
|
+
describe '#horizontal=' do
|
109
|
+
it { instance.must_respond_to(:horizontal=) }
|
110
|
+
end
|
111
|
+
|
112
|
+
describe '#show_bottom' do
|
113
|
+
it { instance.must_respond_to(:show_bottom) }
|
114
|
+
it { instance.must_respond_to(:bottom?) }
|
115
|
+
end
|
116
|
+
|
117
|
+
describe '#show_bottom=' do
|
118
|
+
it { instance.must_respond_to(:show_bottom=) }
|
119
|
+
end
|
120
|
+
|
121
|
+
describe '#show_left' do
|
122
|
+
it { instance.must_respond_to(:show_left) }
|
123
|
+
it { instance.must_respond_to(:left?) }
|
124
|
+
end
|
125
|
+
|
126
|
+
describe '#show_left=' do
|
127
|
+
it { instance.must_respond_to(:show_left=) }
|
128
|
+
end
|
129
|
+
|
130
|
+
describe '#show_right' do
|
131
|
+
it { instance.must_respond_to(:show_right) }
|
132
|
+
it { instance.must_respond_to(:right?) }
|
133
|
+
end
|
134
|
+
|
135
|
+
describe '#show_right=' do
|
136
|
+
it { instance.must_respond_to(:show_right=) }
|
137
|
+
end
|
138
|
+
|
139
|
+
describe '#show_top' do
|
140
|
+
it { instance.must_respond_to(:show_top) }
|
141
|
+
it { instance.must_respond_to(:top?) }
|
142
|
+
end
|
143
|
+
|
144
|
+
describe '#show_top=' do
|
145
|
+
it { instance.must_respond_to(:show_top=) }
|
146
|
+
end
|
147
|
+
|
148
|
+
describe '#title' do
|
149
|
+
it { instance.must_respond_to(:title) }
|
150
|
+
end
|
151
|
+
|
152
|
+
describe '#title=' do
|
153
|
+
it { instance.must_respond_to(:title=) }
|
154
|
+
end
|
155
|
+
|
156
|
+
describe '#top_left' do
|
157
|
+
it { instance.must_respond_to(:top_left) }
|
158
|
+
end
|
159
|
+
|
160
|
+
describe '#top_left=' do
|
161
|
+
it { instance.must_respond_to(:top_left=) }
|
162
|
+
end
|
163
|
+
|
164
|
+
describe '#top_right' do
|
165
|
+
it { instance.must_respond_to(:top_right) }
|
166
|
+
end
|
167
|
+
|
168
|
+
describe '#top_right=' do
|
169
|
+
it { instance.must_respond_to(:top_right=) }
|
170
|
+
end
|
171
|
+
|
172
|
+
describe '#vertical' do
|
173
|
+
it { instance.must_respond_to(:vertical) }
|
174
|
+
end
|
175
|
+
|
176
|
+
describe '#vertical=' do
|
177
|
+
it { instance.must_respond_to(:vertical=) }
|
178
|
+
end
|
179
|
+
|
180
|
+
describe '#name' do
|
181
|
+
it { instance.must_respond_to(:name) }
|
182
|
+
end
|
183
|
+
|
184
|
+
describe '#enabled' do
|
185
|
+
it { instance.must_respond_to(:enabled) }
|
186
|
+
it { instance.must_respond_to(:enabled?) }
|
187
|
+
end
|
188
|
+
|
80
189
|
describe 'border offset methods; bx, bxn, by, byn' do
|
81
190
|
let(:attributes) {
|
82
191
|
{
|
@@ -32,17 +32,17 @@ module Vedeu
|
|
32
32
|
it { described.must_respond_to(:render) }
|
33
33
|
end
|
34
34
|
|
35
|
-
|
36
|
-
|
35
|
+
describe '.by_group' do
|
36
|
+
subject { described.by_group(group) }
|
37
37
|
|
38
|
-
|
39
|
-
|
38
|
+
it { described.must_respond_to(:by_group) }
|
39
|
+
end
|
40
40
|
|
41
|
-
|
42
|
-
|
41
|
+
describe '.by_name' do
|
42
|
+
subject { described.by_name(_name) }
|
43
43
|
|
44
|
-
|
45
|
-
|
44
|
+
it { described.must_respond_to(:by_name) }
|
45
|
+
end
|
46
46
|
|
47
47
|
describe '.clear' do
|
48
48
|
subject { described.clear(interface, options) }
|
@@ -26,29 +26,29 @@ module Vedeu
|
|
26
26
|
|
27
27
|
it { subject.must_be_instance_of(Module) }
|
28
28
|
|
29
|
-
|
30
|
-
|
29
|
+
context 'API' do
|
30
|
+
before { Vedeu::Renderers.renderer(*renderers) }
|
31
31
|
|
32
|
-
|
32
|
+
subject { Vedeu.renderers.render }
|
33
33
|
|
34
|
-
|
35
|
-
|
34
|
+
# context 'when a single renderer is defined' do
|
35
|
+
# let(:renderers) { DummyRenderer }
|
36
36
|
|
37
|
-
|
38
|
-
|
37
|
+
# it { subject.must_equal([:dummy]) }
|
38
|
+
# end
|
39
39
|
|
40
|
-
|
41
|
-
|
40
|
+
# context 'when multiple renderers are defined' do
|
41
|
+
# let(:renderers) { [DummyRenderer, FooRenderer] }
|
42
42
|
|
43
|
-
|
44
|
-
|
43
|
+
# it { subject.must_equal([:dummy, :foo]) }
|
44
|
+
# end
|
45
45
|
|
46
|
-
|
47
|
-
|
46
|
+
context 'when no renderers are defined' do
|
47
|
+
let(:renderers) {}
|
48
48
|
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
it { subject.must_equal([]) }
|
50
|
+
end
|
51
|
+
end
|
52
52
|
end
|
53
53
|
|
54
54
|
describe '.render' do
|
@@ -17,6 +17,14 @@ module Vedeu
|
|
17
17
|
it { instance.instance_variable_get('@value').must_equal('bold') }
|
18
18
|
end
|
19
19
|
|
20
|
+
describe '#value' do
|
21
|
+
it { instance.must_respond_to(:value) }
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '#value=' do
|
25
|
+
it { instance.must_respond_to(:value=) }
|
26
|
+
end
|
27
|
+
|
20
28
|
describe '.coerce' do
|
21
29
|
let(:_value) { 'bold' }
|
22
30
|
|
@@ -19,31 +19,27 @@ module Vedeu
|
|
19
19
|
it { instance.instance_variable_get('@renderer').must_equal(renderer) }
|
20
20
|
end
|
21
21
|
|
22
|
-
describe '
|
23
|
-
|
24
|
-
subject { instance.renderer }
|
22
|
+
describe '#renderer' do
|
23
|
+
subject { instance.renderer }
|
25
24
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
25
|
+
it { subject.must_equal(Vedeu::Renderers::HTML) }
|
26
|
+
end
|
27
|
+
describe '#renderer=' do
|
28
|
+
subject { instance.renderer = (Vedeu::FakeRenderer) }
|
30
29
|
|
31
|
-
|
32
|
-
end
|
30
|
+
it { subject.must_equal(Vedeu::FakeRenderer) }
|
33
31
|
end
|
34
32
|
|
35
|
-
describe '
|
36
|
-
|
37
|
-
subject { instance.height }
|
33
|
+
describe '#height' do
|
34
|
+
subject { instance.height }
|
38
35
|
|
39
|
-
|
40
|
-
|
36
|
+
it { subject.must_equal(3) }
|
37
|
+
end
|
41
38
|
|
42
|
-
|
43
|
-
|
39
|
+
describe '#width' do
|
40
|
+
subject { instance.width }
|
44
41
|
|
45
|
-
|
46
|
-
end
|
42
|
+
it { subject.must_equal(3) }
|
47
43
|
end
|
48
44
|
|
49
45
|
describe '#cells' do
|