vedeu 0.6.8 → 0.6.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (140) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +9 -0
  3. data/README.md +1 -1
  4. data/docs/api.md +60 -67
  5. data/docs/configuration.md +8 -5
  6. data/docs/events.md +31 -15
  7. data/docs/events/application.md +12 -0
  8. data/docs/events/document.md +57 -0
  9. data/docs/events/drb.md +43 -0
  10. data/docs/events/focus.md +24 -0
  11. data/docs/events/menu.md +57 -0
  12. data/docs/events/movement.md +57 -0
  13. data/docs/events/refresh.md +25 -0
  14. data/docs/events/system.md +90 -0
  15. data/docs/events/visibility.md +68 -0
  16. data/lib/vedeu.rb +2 -2
  17. data/lib/vedeu/all.rb +3 -2
  18. data/lib/vedeu/api.rb +18 -18
  19. data/lib/vedeu/application/controller.rb +1 -1
  20. data/lib/vedeu/application/helper.rb +1 -1
  21. data/lib/vedeu/application/view.rb +1 -1
  22. data/lib/vedeu/bindings/application.rb +1 -12
  23. data/lib/vedeu/bindings/bindings.rb +3 -1
  24. data/lib/vedeu/bindings/document.rb +9 -62
  25. data/lib/vedeu/bindings/drb.rb +12 -56
  26. data/lib/vedeu/bindings/focus.rb +3 -28
  27. data/lib/vedeu/bindings/menus.rb +10 -66
  28. data/lib/vedeu/bindings/movement.rb +4 -69
  29. data/lib/vedeu/bindings/refresh.rb +3 -33
  30. data/lib/vedeu/bindings/system.rb +14 -100
  31. data/lib/vedeu/bindings/visibility.rb +20 -71
  32. data/lib/vedeu/borders/all.rb +4 -3
  33. data/lib/vedeu/borders/border.rb +39 -33
  34. data/lib/vedeu/borders/dsl.rb +40 -33
  35. data/lib/vedeu/borders/null.rb +2 -2
  36. data/lib/vedeu/borders/render.rb +29 -24
  37. data/lib/vedeu/borders/repository.rb +2 -2
  38. data/lib/vedeu/buffers/all.rb +8 -7
  39. data/lib/vedeu/buffers/buffer.rb +47 -39
  40. data/lib/vedeu/buffers/null.rb +2 -2
  41. data/lib/vedeu/buffers/refresh.rb +4 -3
  42. data/lib/vedeu/buffers/virtual_buffer.rb +122 -118
  43. data/lib/vedeu/buffers/virtual_buffers.rb +62 -56
  44. data/lib/vedeu/colours/background.rb +2 -1
  45. data/lib/vedeu/colours/colour.rb +21 -19
  46. data/lib/vedeu/colours/foreground.rb +2 -1
  47. data/lib/vedeu/colours/repository.rb +6 -5
  48. data/lib/vedeu/colours/translator.rb +39 -35
  49. data/lib/vedeu/configuration/api.rb +59 -51
  50. data/lib/vedeu/configuration/cli.rb +9 -7
  51. data/lib/vedeu/configuration/configuration.rb +41 -32
  52. data/lib/vedeu/cursors/cursor.rb +1 -1
  53. data/lib/vedeu/cursors/refresh.rb +20 -16
  54. data/lib/vedeu/distributed/server.rb +8 -6
  55. data/lib/vedeu/distributed/subprocess.rb +90 -86
  56. data/lib/vedeu/distributed/uri.rb +4 -3
  57. data/lib/vedeu/dsl/composition.rb +2 -2
  58. data/lib/vedeu/dsl/group.rb +4 -4
  59. data/lib/vedeu/dsl/interface.rb +5 -5
  60. data/lib/vedeu/dsl/presentation.rb +2 -2
  61. data/lib/vedeu/dsl/text.rb +1 -1
  62. data/lib/vedeu/editor/cropper.rb +4 -4
  63. data/lib/vedeu/editor/cursor.rb +6 -4
  64. data/lib/vedeu/editor/document.rb +20 -18
  65. data/lib/vedeu/editor/editor.rb +2 -2
  66. data/lib/vedeu/editor/line.rb +10 -5
  67. data/lib/vedeu/editor/lines.rb +2 -2
  68. data/lib/vedeu/internal_api.rb +4 -4
  69. data/lib/vedeu/models/focus.rb +197 -191
  70. data/lib/vedeu/models/group.rb +171 -159
  71. data/lib/vedeu/models/groups.rb +14 -10
  72. data/lib/vedeu/models/interface.rb +116 -110
  73. data/lib/vedeu/models/interfaces.rb +24 -20
  74. data/lib/vedeu/models/toggleable.rb +4 -4
  75. data/lib/vedeu/models/views/char.rb +1 -1
  76. data/lib/vedeu/models/views/composition.rb +1 -1
  77. data/lib/vedeu/models/views/line.rb +1 -1
  78. data/lib/vedeu/models/views/stream.rb +1 -1
  79. data/lib/vedeu/models/views/view.rb +1 -1
  80. data/lib/vedeu/null/interface.rb +1 -1
  81. data/lib/vedeu/null/view.rb +1 -1
  82. data/lib/vedeu/output/clear/named_interface.rb +1 -1
  83. data/lib/vedeu/output/compressor.rb +78 -73
  84. data/lib/vedeu/output/direct.rb +61 -57
  85. data/lib/vedeu/output/output.rb +34 -29
  86. data/lib/vedeu/output/{presentation.rb → presentation/presentation.rb} +2 -1
  87. data/lib/vedeu/output/presentation/style.rb +64 -18
  88. data/lib/vedeu/output/presentation/styles.rb +39 -0
  89. data/lib/vedeu/output/renderers/html.rb +2 -2
  90. data/lib/vedeu/output/renderers/json.rb +2 -1
  91. data/lib/vedeu/output/renderers/terminal.rb +3 -3
  92. data/lib/vedeu/output/renderers/text.rb +3 -3
  93. data/lib/vedeu/output/text.rb +186 -180
  94. data/lib/vedeu/output/wordwrap.rb +142 -138
  95. data/lib/vedeu/refresh/refresh.rb +2 -2
  96. data/lib/vedeu/templating/helpers.rb +11 -6
  97. data/lib/vedeu/templating/view_template.rb +1 -1
  98. data/lib/vedeu/terminal/terminal.rb +2 -2
  99. data/lib/vedeu/version.rb +1 -1
  100. data/test/lib/vedeu/borders/render_test.rb +1 -1
  101. data/test/lib/vedeu/buffers/buffer_test.rb +16 -14
  102. data/test/lib/vedeu/buffers/virtual_buffer_test.rb +105 -101
  103. data/test/lib/vedeu/buffers/virtual_buffers_test.rb +43 -39
  104. data/test/lib/vedeu/colours/colour_test.rb +4 -4
  105. data/test/lib/vedeu/cursors/cursor_test.rb +2 -2
  106. data/test/lib/vedeu/cursors/repository_test.rb +3 -3
  107. data/test/lib/vedeu/distributed/subprocess_test.rb +33 -29
  108. data/test/lib/vedeu/dsl/group_test.rb +3 -3
  109. data/test/lib/vedeu/dsl/interface_test.rb +6 -5
  110. data/test/lib/vedeu/dsl/line_test.rb +4 -2
  111. data/test/lib/vedeu/dsl/presentation_test.rb +2 -2
  112. data/test/lib/vedeu/dsl/text_test.rb +8 -8
  113. data/test/lib/vedeu/editor/document_test.rb +10 -6
  114. data/test/lib/vedeu/input/keymap_test.rb +1 -10
  115. data/test/lib/vedeu/models/focus_test.rb +177 -170
  116. data/test/lib/vedeu/models/group_test.rb +99 -95
  117. data/test/lib/vedeu/models/groups_test.rb +13 -9
  118. data/test/lib/vedeu/models/interface_test.rb +93 -87
  119. data/test/lib/vedeu/models/interfaces_test.rb +24 -20
  120. data/test/lib/vedeu/models/views/char_test.rb +2 -2
  121. data/test/lib/vedeu/models/views/line_test.rb +11 -7
  122. data/test/lib/vedeu/models/views/stream_test.rb +1 -1
  123. data/test/lib/vedeu/models/views/view_test.rb +1 -1
  124. data/test/lib/vedeu/output/clear/named_group_test.rb +1 -1
  125. data/test/lib/vedeu/output/clear/named_interface_test.rb +3 -1
  126. data/test/lib/vedeu/output/compressor_test.rb +126 -122
  127. data/test/lib/vedeu/output/direct_test.rb +49 -43
  128. data/test/lib/vedeu/output/output_test.rb +35 -31
  129. data/test/lib/vedeu/output/{presentation_test.rb → presentation/presentation_test.rb} +11 -7
  130. data/test/lib/vedeu/output/presentation/style_test.rb +88 -48
  131. data/test/lib/vedeu/output/presentation/styles_test.rb +84 -0
  132. data/test/lib/vedeu/output/text_test.rb +109 -105
  133. data/test/lib/vedeu/output/viewport_test.rb +3 -1
  134. data/test/lib/vedeu/output/wordwrap_test.rb +209 -205
  135. data/test/lib/vedeu/refresh/refresh_test.rb +3 -1
  136. data/test/lib/vedeu/templating/helpers_test.rb +6 -6
  137. data/test/lib/vedeu/templating/view_template_test.rb +1 -1
  138. metadata +17 -8
  139. data/lib/vedeu/output/style.rb +0 -76
  140. data/test/lib/vedeu/output/style_test.rb +0 -120
@@ -19,7 +19,9 @@ module Vedeu
19
19
  end
20
20
  }
21
21
  let(:visible) { true }
22
- let(:interface) { Vedeu::Interface.new(style: nil, visible: visible) }
22
+ let(:interface) {
23
+ Vedeu::Models::Interface.new(style: nil, visible: visible)
24
+ }
23
25
  let(:geometry) { Vedeu::Geometry::Geometry.new(height: 3, width: 3) }
24
26
 
25
27
  before do
@@ -2,107 +2,171 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
- describe Wordwrap do
6
-
7
- let(:described) { Vedeu::Wordwrap }
8
- let(:instance) { described.new(text, options) }
9
- let(:text) { '' }
10
- let(:options) {
11
- {
12
- ellipsis: '...',
13
- mode: mode,
14
- width: width,
5
+ module Output
6
+
7
+ describe Wordwrap do
8
+
9
+ let(:described) { Vedeu::Output::Wordwrap }
10
+ let(:instance) { described.new(text, options) }
11
+ let(:text) { '' }
12
+ let(:options) {
13
+ {
14
+ ellipsis: '...',
15
+ mode: mode,
16
+ width: width,
17
+ }
18
+ }
19
+ let(:mode) { :default }
20
+ let(:width) { 30 }
21
+
22
+ let(:text_line) {
23
+ "Krypton (from Greek: κρυπτός kryptos 'the hidden one')."
24
+ }
25
+ let(:text_block) {
26
+ "Krypton (from Greek: κρυπτός kryptos 'the hidden one') is a " \
27
+ "chemical element with symbol Kr and atomic number 36. It is a " \
28
+ 'member of group 18 (noble gases) elements.'
29
+ }
30
+ let(:text_newlines) {
31
+ "Krypton is a colorless, odorless, tasteless noble gas.\n" \
32
+ "It occurs in trace amounts in the atmosphere.\n" \
33
+ "It is isolated by fractionally distilling liquefied air.\n" \
34
+ "Krypton is often used with other rare gases in fluorescent lamps.\n"
35
+ }
36
+ let(:text_blanklines) {
37
+ "Krypton (from Greek: κρυπτός kryptos 'the hidden one').\n\n" \
38
+ "It is a chemical element with symbol Kr and atomic number 36.\n" \
39
+ "It is a member of group 18 (noble gases) elements.\n\n" \
40
+ '-- Wikipedia'
15
41
  }
16
- }
17
- let(:mode) { :default }
18
- let(:width) { 30 }
19
-
20
- let(:text_line) {
21
- "Krypton (from Greek: κρυπτός kryptos 'the hidden one')."
22
- }
23
- let(:text_block) {
24
- "Krypton (from Greek: κρυπτός kryptos 'the hidden one') is a chemical " \
25
- 'element with symbol Kr and atomic number 36. It is a member of group ' \
26
- '18 (noble gases) elements.'
27
- }
28
- let(:text_newlines) {
29
- "Krypton is a colorless, odorless, tasteless noble gas.\n" \
30
- "It occurs in trace amounts in the atmosphere.\n" \
31
- "It is isolated by fractionally distilling liquefied air.\n" \
32
- "Krypton is often used with other rare gases in fluorescent lamps.\n"
33
- }
34
- let(:text_blanklines) {
35
- "Krypton (from Greek: κρυπτός kryptos 'the hidden one').\n\n" \
36
- "It is a chemical element with symbol Kr and atomic number 36.\n" \
37
- "It is a member of group 18 (noble gases) elements.\n\n" \
38
- '-- Wikipedia'
39
- }
40
- let(:text_line_objects) {
41
- [
42
- Vedeu::Views::Line.new(value: [
43
- Vedeu::Views::Stream.new(
44
- value: 'Krypton is a colorless, odorless, tasteless noble gas.'
45
- )]),
46
- Vedeu::Views::Line.new(value: [
47
- Vedeu::Views::Stream.new(
48
- value: 'It occurs in trace amounts in the atmosphere.'
49
- )]),
50
- Vedeu::Views::Line.new(value: [
51
- Vedeu::Views::Stream.new(
52
- value: 'It is isolated by fractionally distilling liquefied air.'
53
- )]),
54
- Vedeu::Views::Line.new(value: [
55
- Vedeu::Views::Stream.new(
56
- value: 'Krypton is often used with other rare gases in ' \
57
- 'fluorescent lamps.'
58
- )])
59
- ]
60
- }
61
-
62
- describe '#initialize' do
63
- it { instance.must_be_instance_of(described) }
64
- it { instance.instance_variable_get('@text').must_equal(text) }
65
- it { instance.instance_variable_get('@options').must_equal(options) }
66
- end
67
-
68
- describe '#content' do
69
- it { instance.must_respond_to(:content) }
70
- end
71
-
72
- describe '#prune' do
73
- let(:text) { text_line }
74
-
75
- subject { instance.prune }
76
-
77
- context 'when the text is <= the pruning width' do
78
- let(:width) { 80 }
79
-
80
- it { subject.must_be_instance_of(String) }
81
-
82
- it { subject.must_equal(
83
- "Krypton (from Greek: κρυπτός kryptos 'the hidden one')."
84
- ) }
42
+ let(:text_line_objects) {
43
+ [
44
+ Vedeu::Views::Line.new(value: [
45
+ Vedeu::Views::Stream.new(
46
+ value: 'Krypton is a colorless, odorless, tasteless noble gas.'
47
+ )]),
48
+ Vedeu::Views::Line.new(value: [
49
+ Vedeu::Views::Stream.new(
50
+ value: 'It occurs in trace amounts in the atmosphere.'
51
+ )]),
52
+ Vedeu::Views::Line.new(value: [
53
+ Vedeu::Views::Stream.new(
54
+ value: 'It is isolated by fractionally distilling liquefied air.'
55
+ )]),
56
+ Vedeu::Views::Line.new(value: [
57
+ Vedeu::Views::Stream.new(
58
+ value: 'Krypton is often used with other rare gases in ' \
59
+ 'fluorescent lamps.'
60
+ )])
61
+ ]
62
+ }
63
+
64
+ describe '#initialize' do
65
+ it { instance.must_be_instance_of(described) }
66
+ it { instance.instance_variable_get('@text').must_equal(text) }
67
+ it { instance.instance_variable_get('@options').must_equal(options) }
85
68
  end
86
69
 
87
- context 'when the text is > the pruning width' do
70
+ describe '#content' do
71
+ it { instance.must_respond_to(:content) }
72
+ end
73
+
74
+ describe '#prune' do
75
+ let(:text) { text_line }
76
+
77
+ subject { instance.prune }
78
+
79
+ context 'when the text is <= the pruning width' do
80
+ let(:width) { 80 }
81
+
82
+ it { subject.must_be_instance_of(String) }
83
+
84
+ it { subject.must_equal(
85
+ "Krypton (from Greek: κρυπτός kryptos 'the hidden one')."
86
+ ) }
87
+ end
88
+
89
+ context 'when the text is > the pruning width' do
90
+ context 'with a single line of text' do
91
+ it { subject.must_equal('Krypton (from Greek: κρυπτός...') }
92
+ end
93
+
94
+ context 'with a text block' do
95
+ let(:text) { text_block }
96
+
97
+ it { subject.must_equal('Krypton (from Greek: κρυπτός...') }
98
+ end
99
+
100
+ context 'with a text block containing newlines' do
101
+ let(:text) { text_newlines }
102
+
103
+ it { subject.must_equal([
104
+ 'Krypton is a colorless, odor...',
105
+ 'It occurs in trace amounts i...',
106
+ 'It is isolated by fractional...',
107
+ 'Krypton is often used with o...'
108
+ ])
109
+ }
110
+ end
111
+
112
+ context 'with a text block containing newlines and blank lines' do
113
+ let(:text) { text_blanklines }
114
+
115
+ it { subject.must_equal([
116
+ 'Krypton (from Greek: κρυπτός...',
117
+ '',
118
+ 'It is a chemical element wit...',
119
+ 'It is a member of group 18 (...',
120
+ '',
121
+ '-- Wikipedia...'
122
+ ])
123
+ }
124
+ end
125
+ end
126
+ end
127
+
128
+ describe '#wrap' do
129
+ subject { instance.wrap }
130
+
88
131
  context 'with a single line of text' do
89
- it { subject.must_equal('Krypton (from Greek: κρυπτός...') }
132
+ let(:text) { text_line }
133
+
134
+ it { subject.must_equal([
135
+ 'Krypton (from Greek: κρυπτός',
136
+ "kryptos 'the hidden one')."
137
+ ])
138
+ }
90
139
  end
91
140
 
92
141
  context 'with a text block' do
93
142
  let(:text) { text_block }
94
143
 
95
- it { subject.must_equal('Krypton (from Greek: κρυπτός...') }
144
+ it { subject.must_equal([
145
+ 'Krypton (from Greek: κρυπτός',
146
+ "kryptos 'the hidden one') is",
147
+ 'a chemical element with',
148
+ 'symbol Kr and atomic number',
149
+ '36. It is a member of group',
150
+ '18 (noble gases) elements.'
151
+ ])
152
+ }
96
153
  end
97
154
 
98
155
  context 'with a text block containing newlines' do
99
156
  let(:text) { text_newlines }
100
157
 
101
158
  it { subject.must_equal([
102
- 'Krypton is a colorless, odor...',
103
- 'It occurs in trace amounts i...',
104
- 'It is isolated by fractional...',
105
- 'Krypton is often used with o...'
159
+ 'Krypton is a colorless,',
160
+ 'odorless, tasteless noble',
161
+ 'gas.',
162
+ 'It occurs in trace amounts',
163
+ 'in the atmosphere.',
164
+ 'It is isolated by',
165
+ 'fractionally distilling',
166
+ 'liquefied air.',
167
+ 'Krypton is often used with',
168
+ 'other rare gases in',
169
+ 'fluorescent lamps.'
106
170
  ])
107
171
  }
108
172
  end
@@ -111,114 +175,25 @@ module Vedeu
111
175
  let(:text) { text_blanklines }
112
176
 
113
177
  it { subject.must_equal([
114
- 'Krypton (from Greek: κρυπτός...',
178
+ 'Krypton (from Greek: κρυπτός',
179
+ "kryptos 'the hidden one').",
115
180
  '',
116
- 'It is a chemical element wit...',
117
- 'It is a member of group 18 (...',
181
+ 'It is a chemical element',
182
+ 'with symbol Kr and atomic',
183
+ 'number 36.',
184
+ 'It is a member of group 18',
185
+ '(noble gases) elements.',
118
186
  '',
119
- '-- Wikipedia...'
187
+ '-- Wikipedia'
120
188
  ])
121
189
  }
122
190
  end
123
191
  end
124
- end
125
192
 
126
- describe '#wrap' do
127
- subject { instance.wrap }
193
+ describe '.for' do
194
+ subject { described.for(text, options) }
128
195
 
129
- context 'with a single line of text' do
130
- let(:text) { text_line }
131
-
132
- it { subject.must_equal([
133
- 'Krypton (from Greek: κρυπτός',
134
- "kryptos 'the hidden one')."
135
- ])
136
- }
137
- end
138
-
139
- context 'with a text block' do
140
- let(:text) { text_block }
141
-
142
- it { subject.must_equal([
143
- 'Krypton (from Greek: κρυπτός',
144
- "kryptos 'the hidden one') is",
145
- 'a chemical element with',
146
- 'symbol Kr and atomic number',
147
- '36. It is a member of group',
148
- '18 (noble gases) elements.'
149
- ])
150
- }
151
- end
152
-
153
- context 'with a text block containing newlines' do
154
- let(:text) { text_newlines }
155
-
156
- it { subject.must_equal([
157
- 'Krypton is a colorless,',
158
- 'odorless, tasteless noble',
159
- 'gas.',
160
- 'It occurs in trace amounts',
161
- 'in the atmosphere.',
162
- 'It is isolated by',
163
- 'fractionally distilling',
164
- 'liquefied air.',
165
- 'Krypton is often used with',
166
- 'other rare gases in',
167
- 'fluorescent lamps.'
168
- ])
169
- }
170
- end
171
-
172
- context 'with a text block containing newlines and blank lines' do
173
- let(:text) { text_blanklines }
174
-
175
- it { subject.must_equal([
176
- 'Krypton (from Greek: κρυπτός',
177
- "kryptos 'the hidden one').",
178
- '',
179
- 'It is a chemical element',
180
- 'with symbol Kr and atomic',
181
- 'number 36.',
182
- 'It is a member of group 18',
183
- '(noble gases) elements.',
184
- '',
185
- '-- Wikipedia'
186
- ])
187
- }
188
- end
189
- end
190
-
191
- describe '.for' do
192
- subject { described.for(text, options) }
193
-
194
- it { subject.must_be_instance_of(Vedeu::Views::Lines) }
195
-
196
- context 'with a single line of text' do
197
- let(:text) { text_line }
198
-
199
- it { subject.size.must_equal(1) }
200
- end
201
-
202
- context 'with a text block' do
203
- let(:text) { text_block }
204
-
205
- it { subject.size.must_equal(1) }
206
- end
207
-
208
- context 'with a text block containing newlines' do
209
- let(:text) { text_newlines }
210
-
211
- it { subject.size.must_equal(4) }
212
- end
213
-
214
- context 'with a text block containing newlines and blank lines' do
215
- let(:text) { text_blanklines }
216
-
217
- it { subject.size.must_equal(6) }
218
- end
219
-
220
- context 'when mode: :prune' do
221
- let(:mode) { :prune }
196
+ it { subject.must_be_instance_of(Vedeu::Views::Lines) }
222
197
 
223
198
  context 'with a single line of text' do
224
199
  let(:text) { text_line }
@@ -243,37 +218,66 @@ module Vedeu
243
218
 
244
219
  it { subject.size.must_equal(6) }
245
220
  end
246
- end
247
221
 
248
- context 'when mode: :wrap' do
249
- let(:mode) { :wrap }
222
+ context 'when mode: :prune' do
223
+ let(:mode) { :prune }
250
224
 
251
- context 'with a single line of text' do
252
- let(:text) { text_line }
225
+ context 'with a single line of text' do
226
+ let(:text) { text_line }
253
227
 
254
- it { subject.size.must_equal(2) }
255
- end
228
+ it { subject.size.must_equal(1) }
229
+ end
256
230
 
257
- context 'with a text block' do
258
- let(:text) { text_block }
231
+ context 'with a text block' do
232
+ let(:text) { text_block }
259
233
 
260
- it { subject.size.must_equal(6) }
261
- end
234
+ it { subject.size.must_equal(1) }
235
+ end
262
236
 
263
- context 'with a text block containing newlines' do
264
- let(:text) { text_newlines }
237
+ context 'with a text block containing newlines' do
238
+ let(:text) { text_newlines }
239
+
240
+ it { subject.size.must_equal(4) }
241
+ end
242
+
243
+ context 'with a text block containing newlines and blank lines' do
244
+ let(:text) { text_blanklines }
265
245
 
266
- it { subject.size.must_equal(11) }
246
+ it { subject.size.must_equal(6) }
247
+ end
267
248
  end
268
249
 
269
- context 'with a text block containing newlines and blank lines' do
270
- let(:text) { text_blanklines }
250
+ context 'when mode: :wrap' do
251
+ let(:mode) { :wrap }
252
+
253
+ context 'with a single line of text' do
254
+ let(:text) { text_line }
255
+
256
+ it { subject.size.must_equal(2) }
257
+ end
258
+
259
+ context 'with a text block' do
260
+ let(:text) { text_block }
271
261
 
272
- it { subject.size.must_equal(10) }
262
+ it { subject.size.must_equal(6) }
263
+ end
264
+
265
+ context 'with a text block containing newlines' do
266
+ let(:text) { text_newlines }
267
+
268
+ it { subject.size.must_equal(11) }
269
+ end
270
+
271
+ context 'with a text block containing newlines and blank lines' do
272
+ let(:text) { text_blanklines }
273
+
274
+ it { subject.size.must_equal(10) }
275
+ end
273
276
  end
274
277
  end
275
- end
276
278
 
277
- end # Wordwrap
279
+ end # Wordwrap
280
+
281
+ end # Output
278
282
 
279
283
  end # Vedeu