vedeu 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/views/_interfaces.rb +127 -0
- data/examples/views/empty_template.rb +10 -0
- data/examples/views/expected/vedeu_full_screen.html +140 -0
- data/examples/views/expected/vedeu_full_screen.json +96050 -0
- data/examples/views/expected/vedeu_full_screen.out +1 -0
- data/examples/views/expected/vedeu_full_screen.txt +50 -0
- data/examples/views/expected/vedeu_line.html +140 -0
- data/examples/views/expected/vedeu_line.json +96050 -0
- data/examples/views/expected/vedeu_line.out +1 -0
- data/examples/views/expected/vedeu_line.txt +58 -0
- data/examples/views/expected/vedeu_lines.html +140 -0
- data/examples/views/expected/vedeu_lines.json +96050 -0
- data/examples/views/expected/{lines.out → vedeu_lines.out} +1 -1
- data/examples/views/expected/vedeu_lines_alignment.html +80 -0
- data/examples/views/expected/vedeu_lines_alignment.json +46370 -0
- data/examples/views/expected/vedeu_lines_alignment.out +1 -0
- data/examples/views/full_screen.rb +10 -0
- data/examples/views/line.rb +11 -106
- data/examples/views/lines.rb +8 -127
- data/examples/views/lines_alignment.rb +17 -125
- data/examples/views/runner.sh +65 -19
- data/lib/vedeu/borders/border.rb +6 -6
- data/lib/vedeu/borders/refresh.rb +4 -6
- data/lib/vedeu/buffers/buffer.rb +1 -1
- data/lib/vedeu/buffers/terminal.rb +4 -4
- data/lib/vedeu/buffers/view.rb +2 -2
- data/lib/vedeu/cells/all.rb +2 -2
- data/lib/vedeu/cells/border.rb +5 -0
- data/lib/vedeu/cells/borders/all.rb +2 -8
- data/lib/vedeu/cells/borders/edges/all.rb +6 -0
- data/lib/vedeu/cells/borders/{bottom_horizontal.rb → edges/bottom_horizontal.rb} +0 -0
- data/lib/vedeu/cells/borders/{left_vertical.rb → edges/left_vertical.rb} +0 -0
- data/lib/vedeu/cells/borders/{right_vertical.rb → edges/right_vertical.rb} +0 -0
- data/lib/vedeu/cells/borders/{top_horizontal.rb → edges/top_horizontal.rb} +0 -0
- data/lib/vedeu/cells/borders/horizontal.rb +5 -0
- data/lib/vedeu/cells/borders/vertical.rb +5 -0
- data/lib/vedeu/cells/borders/vertices/all.rb +6 -0
- data/lib/vedeu/cells/borders/{bottom_left.rb → vertices/bottom_left.rb} +5 -0
- data/lib/vedeu/cells/borders/{bottom_right.rb → vertices/bottom_right.rb} +5 -0
- data/lib/vedeu/cells/borders/{top_left.rb → vertices/top_left.rb} +5 -0
- data/lib/vedeu/cells/borders/{top_right.rb → vertices/top_right.rb} +5 -0
- data/lib/vedeu/cells/char.rb +16 -0
- data/lib/vedeu/cells/clear.rb +5 -0
- data/lib/vedeu/cells/cursor.rb +70 -0
- data/lib/vedeu/cells/empty.rb +24 -14
- data/lib/vedeu/cells/escape.rb +8 -7
- data/lib/vedeu/cells/support/all.rb +3 -0
- data/lib/vedeu/cells/support/html.rb +98 -0
- data/lib/vedeu/colours/background.rb +21 -1
- data/lib/vedeu/colours/colour.rb +10 -2
- data/lib/vedeu/colours/foreground.rb +21 -1
- data/lib/vedeu/colours/translator.rb +17 -24
- data/lib/vedeu/colours/validator.rb +9 -9
- data/lib/vedeu/configuration/api.rb +1 -1
- data/lib/vedeu/cursors/cursor.rb +5 -5
- data/lib/vedeu/dsl/elements.rb +22 -79
- data/lib/vedeu/dsl/string/text.rb +3 -3
- data/lib/vedeu/editor/cropper.rb +2 -2
- data/lib/vedeu/editor/cursor.rb +1 -1
- data/lib/vedeu/editor/document.rb +1 -1
- data/lib/vedeu/geometries/area/dimension.rb +1 -1
- data/lib/vedeu/geometries/position.rb +5 -2
- data/lib/vedeu/interfaces/clear.rb +5 -5
- data/lib/vedeu/models/row.rb +4 -3
- data/lib/vedeu/output/compressor.rb +7 -7
- data/lib/vedeu/output/output.rb +8 -13
- data/lib/vedeu/output/viewport.rb +1 -1
- data/lib/vedeu/presentation/background.rb +2 -2
- data/lib/vedeu/presentation/colour.rb +0 -4
- data/lib/vedeu/presentation/foreground.rb +2 -2
- data/lib/vedeu/presentation/style.rb +1 -1
- data/lib/vedeu/presentation/styles.rb +0 -3
- data/lib/vedeu/renderers/file.rb +10 -68
- data/lib/vedeu/renderers/html.rb +28 -96
- data/lib/vedeu/renderers/json.rb +15 -31
- data/lib/vedeu/renderers/options.rb +160 -14
- data/lib/vedeu/renderers/templates/html_renderer.vedeu +1 -0
- data/lib/vedeu/renderers/terminal.rb +16 -17
- data/lib/vedeu/renderers/text.rb +32 -41
- data/lib/vedeu/version.rb +1 -1
- data/lib/vedeu/views/all.rb +0 -2
- data/lib/vedeu/views/chars.rb +6 -3
- data/lib/vedeu/views/stream.rb +3 -2
- data/test/lib/vedeu/borders/caption_test.rb +17 -17
- data/test/lib/vedeu/borders/title_test.rb +12 -12
- data/test/lib/vedeu/cells/border_test.rb +6 -0
- data/test/lib/vedeu/cells/borders/{bottom_horizontal_test.rb → edges/bottom_horizontal_test.rb} +0 -0
- data/test/lib/vedeu/cells/borders/{left_vertical_test.rb → edges/left_vertical_test.rb} +0 -0
- data/test/lib/vedeu/cells/borders/{right_vertical_test.rb → edges/right_vertical_test.rb} +0 -0
- data/test/lib/vedeu/cells/borders/{top_horizontal_test.rb → edges/top_horizontal_test.rb} +0 -0
- data/test/lib/vedeu/cells/borders/horizontal_test.rb +6 -0
- data/test/lib/vedeu/cells/borders/vertical_test.rb +6 -0
- data/test/lib/vedeu/cells/borders/{bottom_left_test.rb → vertices/bottom_left_test.rb} +6 -0
- data/test/lib/vedeu/cells/borders/{bottom_right_test.rb → vertices/bottom_right_test.rb} +6 -0
- data/test/lib/vedeu/cells/borders/{top_left_test.rb → vertices/top_left_test.rb} +6 -0
- data/test/lib/vedeu/cells/borders/{top_right_test.rb → vertices/top_right_test.rb} +6 -0
- data/test/lib/vedeu/cells/char_test.rb +18 -0
- data/test/lib/vedeu/cells/clear_test.rb +6 -0
- data/test/lib/vedeu/cells/cursor_test.rb +113 -0
- data/test/lib/vedeu/cells/empty_test.rb +100 -7
- data/test/lib/vedeu/cells/escape_test.rb +29 -13
- data/test/lib/vedeu/cells/support/html_test.rb +100 -0
- data/test/lib/vedeu/colours/background_test.rb +35 -3
- data/test/lib/vedeu/colours/colour_test.rb +66 -0
- data/test/lib/vedeu/colours/foreground_test.rb +35 -3
- data/test/lib/vedeu/colours/translator_test.rb +0 -34
- data/test/lib/vedeu/colours/validator_test.rb +84 -6
- data/test/lib/vedeu/cursors/cursor_test.rb +4 -4
- data/test/lib/vedeu/cursors/refresh_test.rb +4 -1
- data/test/lib/vedeu/dsl/string/text_test.rb +36 -36
- data/test/lib/vedeu/editor/cropper_test.rb +15 -15
- data/test/lib/vedeu/geometries/position_test.rb +14 -1
- data/test/lib/vedeu/models/page_test.rb +10 -10
- data/test/lib/vedeu/models/row_test.rb +7 -7
- data/test/lib/vedeu/output/compressor_test.rb +63 -50
- data/test/lib/vedeu/renderers/file_test.rb +64 -35
- data/test/lib/vedeu/renderers/html_test.rb +15 -12
- data/test/lib/vedeu/renderers/json_test.rb +79 -56
- data/test/lib/vedeu/renderers/options_test.rb +74 -26
- data/test/lib/vedeu/renderers/terminal_test.rb +34 -4
- data/test/lib/vedeu/renderers/text_test.rb +35 -3
- data/test/lib/vedeu/views/chars_test.rb +6 -0
- metadata +50 -41
- data/examples/views/expected/line.out +0 -1
- data/examples/views/expected/lines_alignment.out +0 -1
- data/lib/vedeu/cells/html.rb +0 -21
- data/lib/vedeu/cells/json.rb +0 -21
- data/lib/vedeu/views/char.rb +0 -180
- data/lib/vedeu/views/html_char.rb +0 -133
- data/test/lib/vedeu/cells/html_test.rb +0 -15
- data/test/lib/vedeu/cells/json_test.rb +0 -15
- data/test/lib/vedeu/views/char_test.rb +0 -283
- data/test/lib/vedeu/views/html_char_test.rb +0 -125
@@ -1,283 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'test_helper'
|
4
|
-
|
5
|
-
module Vedeu
|
6
|
-
|
7
|
-
module Views
|
8
|
-
|
9
|
-
describe Chars do
|
10
|
-
|
11
|
-
let(:described) { Vedeu::Views::Chars }
|
12
|
-
let(:instance) { described.new }
|
13
|
-
|
14
|
-
it { described.superclass.must_equal(Vedeu::Repositories::Collection) }
|
15
|
-
|
16
|
-
describe '#initialize' do
|
17
|
-
it { instance.must_be_instance_of(described) }
|
18
|
-
end
|
19
|
-
|
20
|
-
end # Chars
|
21
|
-
|
22
|
-
describe Char do
|
23
|
-
|
24
|
-
let(:described) { Vedeu::Views::Char }
|
25
|
-
let(:instance) { described.new(attributes) }
|
26
|
-
let(:attributes) {
|
27
|
-
{
|
28
|
-
border: border,
|
29
|
-
colour: colour,
|
30
|
-
name: _name,
|
31
|
-
parent: parent,
|
32
|
-
position: position,
|
33
|
-
style: style,
|
34
|
-
value: _value,
|
35
|
-
}
|
36
|
-
}
|
37
|
-
let(:_value) { 'a' }
|
38
|
-
let(:parent) { Vedeu::Views::Line.new(parent_attributes) }
|
39
|
-
let(:parent_attributes) {
|
40
|
-
{
|
41
|
-
value: [],
|
42
|
-
parent: nil,
|
43
|
-
colour: parent_colour,
|
44
|
-
style: parent_style,
|
45
|
-
}
|
46
|
-
}
|
47
|
-
let(:border) { nil }
|
48
|
-
let(:colour) { nil }
|
49
|
-
let(:_name) { 'Vedeu::Views::Char' }
|
50
|
-
let(:style) { nil }
|
51
|
-
let(:position) { nil }
|
52
|
-
let(:parent_colour) { nil }
|
53
|
-
let(:parent_style) { nil }
|
54
|
-
|
55
|
-
describe '#initialize' do
|
56
|
-
it { instance.must_be_instance_of(described) }
|
57
|
-
it { instance.instance_variable_get('@border').must_equal(border) }
|
58
|
-
it { instance.instance_variable_get('@name').must_equal(_name) }
|
59
|
-
it { instance.instance_variable_get('@parent').must_equal(parent) }
|
60
|
-
it { instance.instance_variable_get('@value').must_equal(_value) }
|
61
|
-
end
|
62
|
-
|
63
|
-
describe '#value' do
|
64
|
-
it { instance.must_respond_to(:value) }
|
65
|
-
end
|
66
|
-
|
67
|
-
describe '#border' do
|
68
|
-
it { instance.must_respond_to(:border) }
|
69
|
-
end
|
70
|
-
|
71
|
-
describe '#border=' do
|
72
|
-
it { instance.must_respond_to(:border=) }
|
73
|
-
end
|
74
|
-
|
75
|
-
describe '#name' do
|
76
|
-
it { instance.must_respond_to(:name) }
|
77
|
-
end
|
78
|
-
|
79
|
-
describe '#name=' do
|
80
|
-
it { instance.must_respond_to(:name=) }
|
81
|
-
end
|
82
|
-
|
83
|
-
describe '#parent' do
|
84
|
-
it { instance.must_respond_to(:parent) }
|
85
|
-
end
|
86
|
-
|
87
|
-
describe '#parent=' do
|
88
|
-
it { instance.must_respond_to(:parent=) }
|
89
|
-
end
|
90
|
-
|
91
|
-
describe '#attributes' do
|
92
|
-
it { instance.must_respond_to(:attributes) }
|
93
|
-
end
|
94
|
-
|
95
|
-
describe '#value=' do
|
96
|
-
it { instance.must_respond_to(:value=) }
|
97
|
-
end
|
98
|
-
|
99
|
-
describe '#cell?' do
|
100
|
-
it { instance.cell?.must_equal(false) }
|
101
|
-
end
|
102
|
-
|
103
|
-
describe '#chars' do
|
104
|
-
subject { instance.chars }
|
105
|
-
|
106
|
-
it { subject.must_be_instance_of(Array) }
|
107
|
-
end
|
108
|
-
|
109
|
-
describe '#eql?' do
|
110
|
-
let(:other) { instance }
|
111
|
-
|
112
|
-
subject { instance.eql?(other) }
|
113
|
-
|
114
|
-
it { subject.must_equal(true) }
|
115
|
-
|
116
|
-
context 'when different to other' do
|
117
|
-
let(:other) { described.new(value: 'b') }
|
118
|
-
|
119
|
-
it { subject.must_equal(false) }
|
120
|
-
end
|
121
|
-
end
|
122
|
-
|
123
|
-
describe '#==' do
|
124
|
-
it { instance.must_respond_to(:==) }
|
125
|
-
end
|
126
|
-
|
127
|
-
describe '#interface' do
|
128
|
-
let(:interface) { Vedeu::Interfaces::Interface.new }
|
129
|
-
|
130
|
-
before do
|
131
|
-
Vedeu.interfaces.stubs(:by_name).with(_name).returns(interface)
|
132
|
-
end
|
133
|
-
|
134
|
-
subject { instance.interface }
|
135
|
-
|
136
|
-
it { subject.must_be_instance_of(Vedeu::Interfaces::Interface) }
|
137
|
-
end
|
138
|
-
|
139
|
-
describe '#text' do
|
140
|
-
subject { instance.text }
|
141
|
-
|
142
|
-
it { subject.must_equal('a') }
|
143
|
-
|
144
|
-
context 'when there is a border defined' do
|
145
|
-
let(:border) { :horizontal }
|
146
|
-
|
147
|
-
it { subject.must_equal(' ') }
|
148
|
-
end
|
149
|
-
end
|
150
|
-
|
151
|
-
describe '#to_hash' do
|
152
|
-
let(:position) { Vedeu::Geometries::Position.coerce([17, 2]) }
|
153
|
-
let(:expected) {
|
154
|
-
{
|
155
|
-
border: '',
|
156
|
-
colour: {
|
157
|
-
background: '',
|
158
|
-
foreground: '',
|
159
|
-
},
|
160
|
-
name: 'Vedeu::Views::Char',
|
161
|
-
parent: {
|
162
|
-
background: '',
|
163
|
-
foreground: '',
|
164
|
-
style: '',
|
165
|
-
},
|
166
|
-
position: {
|
167
|
-
y: 17,
|
168
|
-
x: 2,
|
169
|
-
},
|
170
|
-
style: '',
|
171
|
-
value: 'a',
|
172
|
-
}
|
173
|
-
}
|
174
|
-
|
175
|
-
subject { instance.to_hash }
|
176
|
-
|
177
|
-
it { subject.must_be_instance_of(Hash) }
|
178
|
-
|
179
|
-
it { subject.must_equal(expected) }
|
180
|
-
end
|
181
|
-
|
182
|
-
describe '#to_html' do
|
183
|
-
subject { instance.to_html }
|
184
|
-
|
185
|
-
it { subject.must_be_instance_of(String) }
|
186
|
-
end
|
187
|
-
|
188
|
-
describe '#to_s' do
|
189
|
-
subject { instance.to_s }
|
190
|
-
|
191
|
-
it { subject.must_be_instance_of(String) }
|
192
|
-
|
193
|
-
context 'when a position is specified' do
|
194
|
-
let(:position) { Vedeu::Geometries::Position.coerce([17, 2]) }
|
195
|
-
|
196
|
-
it { subject.must_equal("\e[17;2Ha") }
|
197
|
-
end
|
198
|
-
|
199
|
-
context 'when a position is not specified' do
|
200
|
-
let(:position) {}
|
201
|
-
|
202
|
-
it { subject.must_equal('a') }
|
203
|
-
end
|
204
|
-
|
205
|
-
context 'when a colour is specified' do
|
206
|
-
let(:colour) {
|
207
|
-
Vedeu::Colours::Colour.new(foreground: '#00ff00',
|
208
|
-
background: '#005500')
|
209
|
-
}
|
210
|
-
|
211
|
-
context 'and a parent colour is specified' do
|
212
|
-
let(:parent_colour) {
|
213
|
-
Vedeu::Colours::Colour.new(foreground: '#ff0000',
|
214
|
-
background: '#550000')
|
215
|
-
}
|
216
|
-
|
217
|
-
it { subject.must_equal("\e[38;2;0;255;0m\e[48;2;0;85;0ma") }
|
218
|
-
end
|
219
|
-
|
220
|
-
context 'and a parent colour is not specified' do
|
221
|
-
let(:parent_colour) {}
|
222
|
-
|
223
|
-
it { subject.must_equal("\e[38;2;0;255;0m\e[48;2;0;85;0ma") }
|
224
|
-
end
|
225
|
-
end
|
226
|
-
|
227
|
-
context 'when a colour is not specified' do
|
228
|
-
let(:colour) {}
|
229
|
-
|
230
|
-
it { subject.must_equal('a') }
|
231
|
-
end
|
232
|
-
|
233
|
-
context 'when a style is specified' do
|
234
|
-
let(:style) { Vedeu::Presentation::Style.new('underline') }
|
235
|
-
|
236
|
-
context 'when a parent style is specified' do
|
237
|
-
let(:parent_style) { Vedeu::Presentation::Style.new('bold') }
|
238
|
-
|
239
|
-
it { subject.must_equal("\e[4ma") }
|
240
|
-
end
|
241
|
-
|
242
|
-
context 'when a parent style is not specified' do
|
243
|
-
let(:parent_style) {}
|
244
|
-
|
245
|
-
it { subject.must_equal("\e[4ma") }
|
246
|
-
end
|
247
|
-
end
|
248
|
-
|
249
|
-
context 'when a style is not specified' do
|
250
|
-
let(:style) {}
|
251
|
-
|
252
|
-
it { subject.must_equal('a') }
|
253
|
-
end
|
254
|
-
|
255
|
-
context 'when the value is nil' do
|
256
|
-
let(:_value) {}
|
257
|
-
|
258
|
-
it { subject.must_equal('') }
|
259
|
-
end
|
260
|
-
end
|
261
|
-
|
262
|
-
describe '#value' do
|
263
|
-
subject { instance.value }
|
264
|
-
|
265
|
-
it { subject.must_be_instance_of(String) }
|
266
|
-
|
267
|
-
context 'when the border attribute is defined' do
|
268
|
-
let(:border) { :top_left }
|
269
|
-
let(:_value) { "\x6C" }
|
270
|
-
|
271
|
-
it { subject.must_equal("\e(0l\e(B") }
|
272
|
-
end
|
273
|
-
|
274
|
-
context 'when the border attributes is not defined' do
|
275
|
-
it { subject.must_equal('a') }
|
276
|
-
end
|
277
|
-
end
|
278
|
-
|
279
|
-
end # Char
|
280
|
-
|
281
|
-
end # Views
|
282
|
-
|
283
|
-
end # Vedeu
|
@@ -1,125 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'test_helper'
|
4
|
-
|
5
|
-
module Vedeu
|
6
|
-
|
7
|
-
module Views
|
8
|
-
|
9
|
-
describe HTMLChar do
|
10
|
-
|
11
|
-
let(:described) { Vedeu::Views::HTMLChar }
|
12
|
-
let(:instance) { described.new(char, options) }
|
13
|
-
let(:char) { Vedeu::Views::Char.new(attributes) }
|
14
|
-
let(:options) {
|
15
|
-
{
|
16
|
-
start_tag: '<td',
|
17
|
-
end_tag: '</td>',
|
18
|
-
}
|
19
|
-
}
|
20
|
-
let(:attributes) {
|
21
|
-
{
|
22
|
-
border: border,
|
23
|
-
colour: colour,
|
24
|
-
name: _name,
|
25
|
-
parent: parent,
|
26
|
-
value: _value
|
27
|
-
}
|
28
|
-
}
|
29
|
-
let(:border) {}
|
30
|
-
let(:colour) {}
|
31
|
-
let(:_name) { 'Vedeu::Views::HTMLChar' }
|
32
|
-
let(:parent) { Vedeu::Views::Line.new(colour: parent_colour) }
|
33
|
-
let(:parent_colour) {}
|
34
|
-
let(:_value) {}
|
35
|
-
|
36
|
-
describe '#initialize' do
|
37
|
-
it { instance.must_be_instance_of(described) }
|
38
|
-
it { instance.instance_variable_get('@char').must_equal(char) }
|
39
|
-
it { instance.instance_variable_get('@options').must_equal(options) }
|
40
|
-
end
|
41
|
-
|
42
|
-
describe '.render' do
|
43
|
-
subject { described.render(char, options) }
|
44
|
-
|
45
|
-
it { subject.must_be_instance_of(String) }
|
46
|
-
|
47
|
-
context 'when there is a border' do
|
48
|
-
let(:border) { :top_left }
|
49
|
-
|
50
|
-
context 'when there is a colour' do
|
51
|
-
let(:colour) {
|
52
|
-
Vedeu::Colours::Colour.new(background: '#220022',
|
53
|
-
foreground: '#aadd00')
|
54
|
-
}
|
55
|
-
|
56
|
-
it { subject.must_equal(
|
57
|
-
"<td style='" \
|
58
|
-
"border:1px #220022 solid;" \
|
59
|
-
"background:#220022;" \
|
60
|
-
"color:#aadd00;" \
|
61
|
-
"border-top:1px #aadd00 solid;" \
|
62
|
-
"border-left:1px #aadd00 solid;" \
|
63
|
-
"'> </td>"
|
64
|
-
) }
|
65
|
-
end
|
66
|
-
|
67
|
-
context 'when there is no colour' do
|
68
|
-
context 'when there is an interface' do
|
69
|
-
it { subject.must_equal("<td style=''> </td>") }
|
70
|
-
end
|
71
|
-
|
72
|
-
context 'when there is no interface' do
|
73
|
-
let(:_name) {}
|
74
|
-
|
75
|
-
context 'when there is a parent colour' do
|
76
|
-
let(:parent_colour) {
|
77
|
-
Vedeu::Colours::Colour.new(background: '#002222',
|
78
|
-
foreground: '#dd2200')
|
79
|
-
}
|
80
|
-
|
81
|
-
it { subject.must_equal(
|
82
|
-
"<td style='" \
|
83
|
-
"border:1px #002222 solid;" \
|
84
|
-
"background:#002222;" \
|
85
|
-
"color:#dd2200;" \
|
86
|
-
"border-top:1px #dd2200 solid;" \
|
87
|
-
"border-left:1px #dd2200 solid;" \
|
88
|
-
"'> </td>"
|
89
|
-
) }
|
90
|
-
end
|
91
|
-
|
92
|
-
context 'when there is no parent colour' do
|
93
|
-
let(:parent) {}
|
94
|
-
let(:parent_colour) {}
|
95
|
-
|
96
|
-
it { subject.must_equal("<td style=''> </td>") }
|
97
|
-
end
|
98
|
-
end
|
99
|
-
end
|
100
|
-
end
|
101
|
-
|
102
|
-
context 'when there is no border' do
|
103
|
-
context 'when there is no value' do
|
104
|
-
it { subject.must_equal('<td> </td>') }
|
105
|
-
end
|
106
|
-
|
107
|
-
context 'when the value is empty' do
|
108
|
-
let(:_value) { '' }
|
109
|
-
|
110
|
-
it { subject.must_equal('<td> </td>') }
|
111
|
-
end
|
112
|
-
|
113
|
-
context 'when there is a value' do
|
114
|
-
let(:_value) { 'a' }
|
115
|
-
|
116
|
-
it { subject.must_equal("<td style=''>a</td>") }
|
117
|
-
end
|
118
|
-
end
|
119
|
-
end
|
120
|
-
|
121
|
-
end # HTMLChar
|
122
|
-
|
123
|
-
end # Views
|
124
|
-
|
125
|
-
end # Vedeu
|