vedeu 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vedeu/all.rb +2 -13
- data/lib/vedeu/api.rb +9 -9
- data/lib/vedeu/application/application_view.rb +3 -5
- data/lib/vedeu/bindings/bindings.rb +5 -1
- data/lib/vedeu/bindings/focus.rb +0 -5
- data/lib/vedeu/bindings/refresh.rb +0 -5
- data/lib/vedeu/bindings/system.rb +1 -6
- data/lib/vedeu/colours/all.rb +17 -0
- data/lib/vedeu/colours/background.rb +32 -28
- data/lib/vedeu/colours/backgrounds.rb +13 -9
- data/lib/vedeu/colours/colour.rb +106 -102
- data/lib/vedeu/colours/foreground.rb +32 -28
- data/lib/vedeu/colours/foregrounds.rb +13 -9
- data/lib/vedeu/colours/repository.rb +70 -0
- data/lib/vedeu/colours/translator.rb +267 -0
- data/lib/vedeu/configuration/api.rb +10 -7
- data/lib/vedeu/configuration/configuration.rb +2 -1
- data/lib/vedeu/dsl/border.rb +15 -2
- data/lib/vedeu/dsl/composition.rb +6 -4
- data/lib/vedeu/dsl/geometry.rb +14 -7
- data/lib/vedeu/dsl/group.rb +2 -2
- data/lib/vedeu/dsl/interface.rb +5 -3
- data/lib/vedeu/dsl/keymap.rb +9 -7
- data/lib/vedeu/dsl/line.rb +7 -4
- data/lib/vedeu/dsl/menu.rb +3 -0
- data/lib/vedeu/dsl/presentation.rb +20 -10
- data/lib/vedeu/dsl/shared.rb +4 -4
- data/lib/vedeu/dsl/stream.rb +2 -2
- data/lib/vedeu/dsl/text.rb +11 -5
- data/lib/vedeu/dsl/use.rb +2 -2
- data/lib/vedeu/dsl/view.rb +8 -6
- data/lib/vedeu/events/aliases.rb +91 -0
- data/lib/vedeu/events/all.rb +15 -0
- data/lib/vedeu/events/collection.rb +13 -0
- data/lib/vedeu/events/event.rb +244 -239
- data/lib/vedeu/events/repository.rb +30 -0
- data/lib/vedeu/events/trigger.rb +68 -64
- data/lib/vedeu/exceptions.rb +65 -54
- data/lib/vedeu/geometry/coordinate.rb +3 -1
- data/lib/vedeu/geometry/grid.rb +2 -4
- data/lib/vedeu/input/editor/all.rb +2 -1
- data/lib/vedeu/input/editor/{virtual_cursor.rb → cursor.rb} +10 -10
- data/lib/vedeu/input/editor/document.rb +7 -7
- data/lib/vedeu/input/editor/insert.rb +70 -0
- data/lib/vedeu/input/editor/line.rb +4 -16
- data/lib/vedeu/input/editor/lines.rb +2 -16
- data/lib/vedeu/input/input_translator.rb +2 -2
- data/lib/vedeu/input/key.rb +2 -2
- data/lib/vedeu/internal_api.rb +6 -6
- data/lib/vedeu/log/lockless_log_device.rb +0 -74
- data/lib/vedeu/models/focus.rb +3 -3
- data/lib/vedeu/models/interface.rb +3 -3
- data/lib/vedeu/models/menu.rb +2 -2
- data/lib/vedeu/models/views/char.rb +1 -1
- data/lib/vedeu/models/views/composition.rb +1 -1
- data/lib/vedeu/models/views/line.rb +1 -1
- data/lib/vedeu/models/views/stream.rb +1 -1
- data/lib/vedeu/models/views/view.rb +6 -7
- data/lib/vedeu/output/presentation/colour.rb +23 -21
- data/lib/vedeu/output/renderers/renderer_options.rb +2 -4
- data/lib/vedeu/output/text.rb +1 -1
- data/lib/vedeu/output/wordwrap.rb +18 -7
- data/lib/vedeu/plugins/plugin.rb +2 -2
- data/lib/vedeu/refresh/refresh_buffer.rb +3 -3
- data/lib/vedeu/refresh/refresh_group.rb +3 -3
- data/lib/vedeu/repositories/repository.rb +7 -6
- data/lib/vedeu/runtime/application.rb +1 -1
- data/lib/vedeu/runtime/main_loop.rb +3 -3
- data/lib/vedeu/runtime/router.rb +14 -11
- data/lib/vedeu/templating/helpers.rb +5 -5
- data/lib/vedeu/templating/template.rb +4 -4
- data/lib/vedeu/templating/view_template.rb +1 -1
- data/lib/vedeu/terminal/terminal.rb +2 -2
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/application/application_view_test.rb +1 -1
- data/test/lib/vedeu/colours/background_test.rb +93 -89
- data/test/lib/vedeu/colours/backgrounds_test.rb +11 -7
- data/test/lib/vedeu/colours/colour_test.rb +155 -151
- data/test/lib/vedeu/colours/foreground_test.rb +93 -89
- data/test/lib/vedeu/colours/foregrounds_test.rb +11 -7
- data/test/lib/vedeu/colours/repository_test.rb +97 -0
- data/test/lib/vedeu/colours/translator_test.rb +173 -0
- data/test/lib/vedeu/configuration/api_test.rb +4 -4
- data/test/lib/vedeu/dsl/border_test.rb +12 -0
- data/test/lib/vedeu/dsl/composition_test.rb +3 -3
- data/test/lib/vedeu/dsl/geometry_test.rb +11 -0
- data/test/lib/vedeu/dsl/group_test.rb +2 -2
- data/test/lib/vedeu/dsl/interface_test.rb +4 -4
- data/test/lib/vedeu/dsl/keymap_test.rb +8 -4
- data/test/lib/vedeu/dsl/line_test.rb +6 -3
- data/test/lib/vedeu/dsl/menu_test.rb +6 -0
- data/test/lib/vedeu/dsl/presentation_test.rb +16 -3
- data/test/lib/vedeu/dsl/stream_test.rb +1 -1
- data/test/lib/vedeu/dsl/text_test.rb +7 -0
- data/test/lib/vedeu/dsl/view_test.rb +3 -3
- data/test/lib/vedeu/events/aliases_test.rb +144 -0
- data/test/lib/vedeu/events/collection_test.rb +22 -0
- data/test/lib/vedeu/events/event_test.rb +84 -80
- data/test/lib/vedeu/events/repository_test.rb +28 -0
- data/test/lib/vedeu/events/trigger_test.rb +41 -37
- data/test/lib/vedeu/geometry/grid_test.rb +4 -4
- data/test/lib/vedeu/input/editor/{virtual_cursor_test.rb → cursor_test.rb} +3 -3
- data/test/lib/vedeu/input/editor/insert_test.rb +36 -0
- data/test/lib/vedeu/input/key_test.rb +1 -1
- data/test/lib/vedeu/models/cell_test.rb +1 -1
- data/test/lib/vedeu/models/focus_test.rb +4 -2
- data/test/lib/vedeu/models/menu_test.rb +1 -1
- data/test/lib/vedeu/models/views/char_test.rb +8 -4
- data/test/lib/vedeu/models/views/line_test.rb +4 -4
- data/test/lib/vedeu/models/views/stream_test.rb +3 -3
- data/test/lib/vedeu/models/views/view_test.rb +1 -1
- data/test/lib/vedeu/output/html_char_test.rb +4 -2
- data/test/lib/vedeu/output/presentation/colour_test.rb +5 -5
- data/test/lib/vedeu/output/presentation_test.rb +4 -4
- data/test/lib/vedeu/output/renderers/json_test.rb +4 -2
- data/test/lib/vedeu/plugins/plugin_test.rb +1 -1
- data/test/lib/vedeu/refresh/refresh_buffer_test.rb +1 -1
- data/test/lib/vedeu/refresh/refresh_group_test.rb +1 -1
- data/test/lib/vedeu/repositories/repository_test.rb +2 -2
- data/test/lib/vedeu/runtime/router_test.rb +6 -6
- data/test/lib/vedeu/templating/decoder_test.rb +2 -3
- data/test/lib/vedeu/templating/encoder_test.rb +2 -3
- data/test/lib/vedeu/templating/helpers_test.rb +6 -6
- data/test/lib/vedeu/templating/template_test.rb +2 -2
- data/test/lib/vedeu/templating/view_template_test.rb +13 -7
- data/test/lib/vedeu/terminal/terminal_test.rb +3 -3
- metadata +24 -19
- data/lib/vedeu/colours/colour_translator.rb +0 -260
- data/lib/vedeu/colours/colours.rb +0 -66
- data/lib/vedeu/events/event_aliases.rb +0 -87
- data/lib/vedeu/events/event_collection.rb +0 -9
- data/lib/vedeu/events/events.rb +0 -26
- data/test/lib/vedeu/colours/colour_translator_test.rb +0 -169
- data/test/lib/vedeu/colours/colours_test.rb +0 -93
- data/test/lib/vedeu/events/event_aliases_test.rb +0 -140
- data/test/lib/vedeu/events/event_collection_test.rb +0 -18
- data/test/lib/vedeu/events/events_test.rb +0 -24
@@ -2,16 +2,20 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
module Vedeu
|
4
4
|
|
5
|
-
|
5
|
+
module Colours
|
6
6
|
|
7
|
-
|
7
|
+
describe Foregrounds do
|
8
8
|
|
9
|
-
|
10
|
-
subject { described.foreground_colours }
|
9
|
+
let(:described) { Vedeu::Colours::Foregrounds }
|
11
10
|
|
12
|
-
|
13
|
-
|
11
|
+
describe '.foreground_colours' do
|
12
|
+
subject { described.foreground_colours }
|
14
13
|
|
15
|
-
|
14
|
+
it { subject.must_be_instance_of(described) }
|
15
|
+
end
|
16
|
+
|
17
|
+
end # Foregrounds
|
18
|
+
|
19
|
+
end # Colours
|
16
20
|
|
17
21
|
end # Vedeu
|
@@ -0,0 +1,97 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Vedeu
|
4
|
+
|
5
|
+
module Colours
|
6
|
+
|
7
|
+
describe Repository do
|
8
|
+
|
9
|
+
let(:described) { Vedeu::Colours::Repository }
|
10
|
+
let(:instance) { described.new }
|
11
|
+
|
12
|
+
describe '#initialize' do
|
13
|
+
it { instance.must_be_instance_of(described) }
|
14
|
+
it { instance.instance_variable_get('@storage').must_equal({}) }
|
15
|
+
end
|
16
|
+
|
17
|
+
describe 'accessors' do
|
18
|
+
it { instance.must_respond_to(:storage) }
|
19
|
+
end
|
20
|
+
|
21
|
+
describe '#register' do
|
22
|
+
let(:colour) { 'ff0000' }
|
23
|
+
let(:escape_sequence) { 'fake_escape_sequence' }
|
24
|
+
|
25
|
+
subject { instance.register(colour, escape_sequence) }
|
26
|
+
|
27
|
+
it { subject.must_equal('fake_escape_sequence') }
|
28
|
+
end
|
29
|
+
|
30
|
+
describe '#registered?' do
|
31
|
+
let(:colour) {}
|
32
|
+
|
33
|
+
subject { instance.registered?(colour) }
|
34
|
+
|
35
|
+
context 'when the colour is registered' do
|
36
|
+
let(:colour) { '#aa0000' }
|
37
|
+
|
38
|
+
before { instance.register(colour, 'fake_escape_sequence') }
|
39
|
+
|
40
|
+
it { subject.must_equal(true) }
|
41
|
+
end
|
42
|
+
|
43
|
+
context 'when the colour is not registered' do
|
44
|
+
it { subject.must_equal(false) }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe '#reset!' do
|
49
|
+
subject { instance.reset! }
|
50
|
+
|
51
|
+
it { subject.must_be_instance_of(Hash) }
|
52
|
+
|
53
|
+
it { subject.must_equal({}) }
|
54
|
+
end
|
55
|
+
|
56
|
+
describe '#retrieve' do
|
57
|
+
let(:colour) {}
|
58
|
+
|
59
|
+
subject { instance.retrieve(colour) }
|
60
|
+
|
61
|
+
context 'when the colour can be found' do
|
62
|
+
let(:colour) { '#bb0000' }
|
63
|
+
|
64
|
+
before { instance.register(colour, 'fake_escape_sequence') }
|
65
|
+
|
66
|
+
it { subject.must_equal('fake_escape_sequence') }
|
67
|
+
end
|
68
|
+
|
69
|
+
context 'when the colour cannot be found' do
|
70
|
+
it { subject.must_equal('') }
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
describe '#retrieve_or_register' do
|
75
|
+
let(:colour) { '#cc0000' }
|
76
|
+
let(:escape_sequence) { 'escape_sequence' }
|
77
|
+
|
78
|
+
subject { instance.retrieve_or_register(colour, escape_sequence) }
|
79
|
+
|
80
|
+
context 'when the colour is registered' do
|
81
|
+
let(:colour) { '#cc0000' }
|
82
|
+
|
83
|
+
before { instance.register(colour, 'fake_escape_sequence') }
|
84
|
+
|
85
|
+
it { subject.must_equal('fake_escape_sequence') }
|
86
|
+
end
|
87
|
+
|
88
|
+
context 'when the colour is not registered' do
|
89
|
+
it { subject.must_equal('escape_sequence') }
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
end # Repository
|
94
|
+
|
95
|
+
end # Colours
|
96
|
+
|
97
|
+
end # Vedeu
|
@@ -0,0 +1,173 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Vedeu
|
4
|
+
|
5
|
+
module Colours
|
6
|
+
|
7
|
+
describe Translator do
|
8
|
+
|
9
|
+
let(:described) { Vedeu::Colours::Translator }
|
10
|
+
let(:instance) { described.new(colour) }
|
11
|
+
let(:colour) { '#ff0000' }
|
12
|
+
|
13
|
+
describe '#initialize' do
|
14
|
+
it { instance.must_be_instance_of(described) }
|
15
|
+
it { instance.instance_variable_get('@colour').must_equal(colour) }
|
16
|
+
end
|
17
|
+
|
18
|
+
describe 'accessors' do
|
19
|
+
it { instance.must_respond_to(:colour) }
|
20
|
+
it { instance.must_respond_to(:value) }
|
21
|
+
end
|
22
|
+
|
23
|
+
describe '.coerce' do
|
24
|
+
let(:_value) {}
|
25
|
+
|
26
|
+
subject { described.coerce(_value) }
|
27
|
+
|
28
|
+
context 'when the value is nil' do
|
29
|
+
it { subject.must_be_instance_of(described) }
|
30
|
+
|
31
|
+
it {
|
32
|
+
Vedeu::Colours::Background.coerce(_value).
|
33
|
+
must_be_instance_of(Vedeu::Colours::Background)
|
34
|
+
}
|
35
|
+
it { Vedeu::Colours::Background.coerce(_value).colour.must_equal('') }
|
36
|
+
it {
|
37
|
+
Vedeu::Colours::Foreground.coerce(_value).
|
38
|
+
must_be_instance_of(Vedeu::Colours::Foreground)
|
39
|
+
}
|
40
|
+
it { Vedeu::Colours::Foreground.coerce(_value).colour.must_equal('') }
|
41
|
+
end
|
42
|
+
|
43
|
+
context 'when the value is a Vedeu::Colours::Background' do
|
44
|
+
let(:_value) { Vedeu::Colours::Background.new }
|
45
|
+
|
46
|
+
it { subject.must_equal(_value) }
|
47
|
+
end
|
48
|
+
|
49
|
+
context 'when the value is a Vedeu::Colours::Foreground' do
|
50
|
+
let(:_value) { Vedeu::Colours::Foreground.new }
|
51
|
+
|
52
|
+
it { subject.must_equal(_value) }
|
53
|
+
end
|
54
|
+
|
55
|
+
context 'when the value is not a polymorphic Colour' do
|
56
|
+
let(:_value) { '#aadd00' }
|
57
|
+
|
58
|
+
it { subject.must_be_instance_of(described) }
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
describe '#empty?' do
|
63
|
+
subject { instance.empty? }
|
64
|
+
|
65
|
+
context 'when there is no colour' do
|
66
|
+
let(:colour) {}
|
67
|
+
|
68
|
+
it { subject.must_equal(true) }
|
69
|
+
end
|
70
|
+
|
71
|
+
context 'when there is a colour' do
|
72
|
+
it { subject.must_equal(false) }
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
describe '#eql?' do
|
77
|
+
let(:other) { instance }
|
78
|
+
|
79
|
+
subject { instance.eql?(other) }
|
80
|
+
|
81
|
+
it { subject.must_equal(true) }
|
82
|
+
|
83
|
+
context 'when different to other' do
|
84
|
+
let(:other) { described.new('#ff00ff') }
|
85
|
+
|
86
|
+
it { subject.must_equal(false) }
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
describe '#escape_sequence' do
|
91
|
+
subject { instance.escape_sequence }
|
92
|
+
|
93
|
+
context 'when no colour is given' do
|
94
|
+
let(:colour) {}
|
95
|
+
|
96
|
+
it { subject.must_equal('') }
|
97
|
+
end
|
98
|
+
|
99
|
+
context 'when the colour is a terminal named colour; e.g. :red' do
|
100
|
+
let(:colour) { :red }
|
101
|
+
|
102
|
+
it 'raises an exception since the subclasses Background and ' \
|
103
|
+
'Foreground handle this' do
|
104
|
+
proc { subject }.must_raise(Vedeu::Error::NotImplemented)
|
105
|
+
end
|
106
|
+
end
|
107
|
+
|
108
|
+
context 'when the colour is a terminal numbered colour; e.g. 122' do
|
109
|
+
let(:colour) { 122 }
|
110
|
+
|
111
|
+
it 'raises an exception since the subclasses Background and ' \
|
112
|
+
'Foreground handle this' do
|
113
|
+
proc { subject }.must_raise(Vedeu::Error::NotImplemented)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
context 'when the colour is a HTML/CSS colour (RGB specified)' do
|
118
|
+
let(:colour) { '#ff0000' }
|
119
|
+
|
120
|
+
it 'raises an exception since the subclasses Background and ' \
|
121
|
+
'Foreground handle this' do
|
122
|
+
proc { subject }.must_raise(Vedeu::Error::NotImplemented)
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
context 'when the colour is not supported' do
|
127
|
+
let(:colour) { [:not_supported] }
|
128
|
+
|
129
|
+
before { instance.stubs(:registered?).returns(false) }
|
130
|
+
|
131
|
+
it { subject.must_equal('') }
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
describe '#to_html' do
|
136
|
+
subject { instance.to_html }
|
137
|
+
|
138
|
+
context 'when no colour is given' do
|
139
|
+
let(:colour) {}
|
140
|
+
|
141
|
+
it { subject.must_equal('') }
|
142
|
+
end
|
143
|
+
|
144
|
+
context 'when the colour is a terminal named colour; e.g. :red' do
|
145
|
+
let(:colour) { :red }
|
146
|
+
|
147
|
+
it { subject.must_equal('') }
|
148
|
+
end
|
149
|
+
|
150
|
+
context 'when the colour is a terminal numbered colour; e.g. 122' do
|
151
|
+
let(:colour) { 122 }
|
152
|
+
|
153
|
+
it { subject.must_equal('') }
|
154
|
+
end
|
155
|
+
|
156
|
+
context 'when the colour is a HTML/CSS colour (RGB specified)' do
|
157
|
+
let(:colour) { '#ff0000' }
|
158
|
+
|
159
|
+
it { subject.must_equal('#ff0000') }
|
160
|
+
end
|
161
|
+
|
162
|
+
context 'when the colour is not supported' do
|
163
|
+
let(:colour) { [:not_supported] }
|
164
|
+
|
165
|
+
it { subject.must_equal('') }
|
166
|
+
end
|
167
|
+
end
|
168
|
+
|
169
|
+
end # Translator
|
170
|
+
|
171
|
+
end # Colours
|
172
|
+
|
173
|
+
end # Vedeu
|
@@ -213,19 +213,19 @@ module Vedeu
|
|
213
213
|
context 'when the value is invalid (nil)' do
|
214
214
|
it { proc {
|
215
215
|
Vedeu.configure { colour_mode(nil) }
|
216
|
-
}.must_raise(Vedeu::InvalidSyntax) }
|
216
|
+
}.must_raise(Vedeu::Error::InvalidSyntax) }
|
217
217
|
end
|
218
218
|
|
219
219
|
context 'when the value is invalid (empty)' do
|
220
220
|
it { proc {
|
221
221
|
Vedeu.configure { colour_mode('') }
|
222
|
-
}.must_raise(Vedeu::InvalidSyntax) }
|
222
|
+
}.must_raise(Vedeu::Error::InvalidSyntax) }
|
223
223
|
end
|
224
224
|
|
225
225
|
context 'when the value is invalid' do
|
226
226
|
it { proc {
|
227
227
|
Vedeu.configure { colour_mode(1234) }
|
228
|
-
}.must_raise(Vedeu::InvalidSyntax) }
|
228
|
+
}.must_raise(Vedeu::Error::InvalidSyntax) }
|
229
229
|
end
|
230
230
|
|
231
231
|
it 'sets the option to the desired value' do
|
@@ -346,7 +346,7 @@ module Vedeu
|
|
346
346
|
it {
|
347
347
|
proc {
|
348
348
|
Vedeu.configure { terminal_mode(:invalid) }
|
349
|
-
}.must_raise(Vedeu::InvalidSyntax)
|
349
|
+
}.must_raise(Vedeu::Error::InvalidSyntax)
|
350
350
|
}
|
351
351
|
end
|
352
352
|
end
|
@@ -30,6 +30,7 @@ module Vedeu
|
|
30
30
|
|
31
31
|
it { subject.must_be_instance_of(String) }
|
32
32
|
it { subject.must_equal('C') }
|
33
|
+
it { instance.must_respond_to(:bottom_left=) }
|
33
34
|
end
|
34
35
|
|
35
36
|
describe '#bottom_right' do
|
@@ -39,6 +40,7 @@ module Vedeu
|
|
39
40
|
|
40
41
|
it { subject.must_be_instance_of(String) }
|
41
42
|
it { subject.must_equal('D') }
|
43
|
+
it { instance.must_respond_to(:bottom_right=) }
|
42
44
|
end
|
43
45
|
|
44
46
|
describe '#disable!' do
|
@@ -60,6 +62,7 @@ module Vedeu
|
|
60
62
|
|
61
63
|
it { subject.must_be_instance_of(String) }
|
62
64
|
it { subject.must_equal('H') }
|
65
|
+
it { instance.must_respond_to(:horizontal=) }
|
63
66
|
end
|
64
67
|
|
65
68
|
describe '#show_bottom' do
|
@@ -75,6 +78,7 @@ module Vedeu
|
|
75
78
|
end
|
76
79
|
|
77
80
|
it { instance.must_respond_to(:bottom) }
|
81
|
+
it { instance.must_respond_to(:bottom=) }
|
78
82
|
end
|
79
83
|
|
80
84
|
describe '#hide_bottom!' do
|
@@ -95,6 +99,7 @@ module Vedeu
|
|
95
99
|
it { subject.must_be_instance_of(TrueClass) }
|
96
100
|
|
97
101
|
it { instance.must_respond_to(:left) }
|
102
|
+
it { instance.must_respond_to(:left=) }
|
98
103
|
|
99
104
|
context 'when false' do
|
100
105
|
let(:boolean) { false }
|
@@ -121,6 +126,7 @@ module Vedeu
|
|
121
126
|
it { subject.must_be_instance_of(TrueClass) }
|
122
127
|
|
123
128
|
it { instance.must_respond_to(:right) }
|
129
|
+
it { instance.must_respond_to(:right=) }
|
124
130
|
|
125
131
|
context 'when false' do
|
126
132
|
let(:boolean) { false }
|
@@ -147,6 +153,7 @@ module Vedeu
|
|
147
153
|
it { subject.must_be_instance_of(TrueClass) }
|
148
154
|
|
149
155
|
it { instance.must_respond_to(:top) }
|
156
|
+
it { instance.must_respond_to(:top=) }
|
150
157
|
|
151
158
|
context 'when false' do
|
152
159
|
let(:boolean) { false }
|
@@ -174,6 +181,7 @@ module Vedeu
|
|
174
181
|
|
175
182
|
it { subject.must_be_instance_of(String) }
|
176
183
|
it { subject.must_equal('Some title') }
|
184
|
+
it { instance.must_respond_to(:title=) }
|
177
185
|
end
|
178
186
|
|
179
187
|
describe '#caption' do
|
@@ -183,6 +191,7 @@ module Vedeu
|
|
183
191
|
|
184
192
|
it { subject.must_be_instance_of(String) }
|
185
193
|
it { subject.must_equal('Some caption') }
|
194
|
+
it { instance.must_respond_to(:caption=) }
|
186
195
|
end
|
187
196
|
|
188
197
|
describe '#top_left' do
|
@@ -192,6 +201,7 @@ module Vedeu
|
|
192
201
|
|
193
202
|
it { subject.must_be_instance_of(String) }
|
194
203
|
it { subject.must_equal('A') }
|
204
|
+
it { instance.must_respond_to(:top_left=) }
|
195
205
|
end
|
196
206
|
|
197
207
|
describe '#top_right' do
|
@@ -201,6 +211,7 @@ module Vedeu
|
|
201
211
|
|
202
212
|
it { subject.must_be_instance_of(String) }
|
203
213
|
it { subject.must_equal('B') }
|
214
|
+
it { instance.must_respond_to(:top_right=) }
|
204
215
|
end
|
205
216
|
|
206
217
|
describe '#use' do
|
@@ -229,6 +240,7 @@ module Vedeu
|
|
229
240
|
|
230
241
|
it { subject.must_be_instance_of(String) }
|
231
242
|
it { subject.must_equal('V') }
|
243
|
+
it { instance.must_respond_to(:vertical=) }
|
232
244
|
end
|
233
245
|
|
234
246
|
end # Border
|
@@ -28,7 +28,7 @@ module Vedeu
|
|
28
28
|
it { subject[0].must_be_instance_of(Vedeu::Views::View) }
|
29
29
|
|
30
30
|
context 'when the block is not given' do
|
31
|
-
it { proc { instance.view }.must_raise(Vedeu::InvalidSyntax) }
|
31
|
+
it { proc { instance.view }.must_raise(Vedeu::Error::InvalidSyntax) }
|
32
32
|
end
|
33
33
|
end
|
34
34
|
|
@@ -44,13 +44,13 @@ module Vedeu
|
|
44
44
|
context 'when the name of the view is not given' do
|
45
45
|
let(:filename) { 'my_interface.erb' }
|
46
46
|
|
47
|
-
it { proc { subject }.must_raise(Vedeu::MissingRequired) }
|
47
|
+
it { proc { subject }.must_raise(Vedeu::Error::MissingRequired) }
|
48
48
|
end
|
49
49
|
|
50
50
|
context 'when the filename of the template is not given' do
|
51
51
|
let(:_name) { 'my_interface' }
|
52
52
|
|
53
|
-
it { proc { subject }.must_raise(Vedeu::MissingRequired) }
|
53
|
+
it { proc { subject }.must_raise(Vedeu::Error::MissingRequired) }
|
54
54
|
end
|
55
55
|
|
56
56
|
context 'when the name and filename are given' do
|