vedeu 0.6.69 → 0.6.70

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/docs/api.md +4 -0
  3. data/lib/vedeu/all.rb +5 -7
  4. data/lib/vedeu/borders/all.rb +1 -0
  5. data/lib/vedeu/borders/repository.rb +2 -6
  6. data/lib/vedeu/borders/set_attribute.rb +71 -0
  7. data/lib/vedeu/buffers/buffer.rb +6 -1
  8. data/lib/vedeu/buffers/refresh.rb +6 -1
  9. data/lib/vedeu/common.rb +2 -1
  10. data/lib/vedeu/configuration/configuration.rb +1 -1
  11. data/lib/vedeu/cursors/all.rb +1 -0
  12. data/lib/vedeu/cursors/cursor.rb +8 -27
  13. data/lib/vedeu/cursors/move.rb +69 -0
  14. data/lib/vedeu/cursors/repository.rb +1 -1
  15. data/lib/vedeu/dsl/all.rb +2 -0
  16. data/lib/vedeu/dsl/composition.rb +6 -1
  17. data/lib/vedeu/dsl/lines.rb +21 -0
  18. data/lib/vedeu/dsl/streams.rb +21 -0
  19. data/lib/vedeu/groups/clear.rb +6 -1
  20. data/lib/vedeu/groups/refresh.rb +6 -1
  21. data/lib/vedeu/input/capture.rb +6 -1
  22. data/lib/vedeu/interfaces/clear.rb +6 -1
  23. data/lib/vedeu/interfaces/interface.rb +20 -8
  24. data/lib/vedeu/models/all.rb +1 -0
  25. data/lib/vedeu/models/focus.rb +19 -14
  26. data/lib/vedeu/models/page.rb +5 -0
  27. data/lib/vedeu/models/row.rb +5 -0
  28. data/lib/vedeu/models/toggleable.rb +6 -1
  29. data/lib/vedeu/null/all.rb +0 -1
  30. data/lib/vedeu/output/all.rb +0 -2
  31. data/lib/vedeu/output/compressor.rb +2 -1
  32. data/lib/vedeu/output/wordwrap.rb +6 -1
  33. data/lib/vedeu/output/write.rb +2 -0
  34. data/lib/vedeu/presentation/all.rb +17 -0
  35. data/lib/vedeu/presentation/background.rb +47 -0
  36. data/lib/vedeu/presentation/colour.rb +42 -0
  37. data/lib/vedeu/presentation/foreground.rb +47 -0
  38. data/lib/vedeu/{output/presentation → presentation}/presentation.rb +0 -0
  39. data/lib/vedeu/{output/presentation → presentation}/style.rb +0 -0
  40. data/lib/vedeu/presentation/styles.rb +45 -0
  41. data/lib/vedeu/{output/renderers → renderers}/all.rb +5 -5
  42. data/lib/vedeu/{output/renderers → renderers}/file.rb +0 -0
  43. data/lib/vedeu/{output/renderers → renderers}/html.rb +0 -0
  44. data/lib/vedeu/{output/renderers → renderers}/json.rb +0 -0
  45. data/lib/vedeu/{output/renderers → renderers}/options.rb +5 -1
  46. data/lib/vedeu/{output → renderers}/templates/html_renderer.vedeu +0 -0
  47. data/lib/vedeu/{output/renderers → renderers}/terminal.rb +1 -1
  48. data/lib/vedeu/repositories/all.rb +1 -0
  49. data/lib/vedeu/repositories/parent.rb +32 -0
  50. data/lib/vedeu/repositories/repositories.rb +1 -0
  51. data/lib/vedeu/runtime/flags.rb +2 -0
  52. data/lib/vedeu/templating/view_template.rb +6 -1
  53. data/lib/vedeu/version.rb +1 -1
  54. data/lib/vedeu/views/all.rb +20 -0
  55. data/lib/vedeu/{models/views → views}/char.rb +33 -21
  56. data/lib/vedeu/views/chars.rb +15 -0
  57. data/lib/vedeu/{models/views → views}/composition.rb +0 -0
  58. data/lib/vedeu/{models/views → views}/html_char.rb +0 -0
  59. data/lib/vedeu/{models/views → views}/line.rb +17 -21
  60. data/lib/vedeu/views/lines.rb +15 -0
  61. data/lib/vedeu/{models/views → views}/stream.rb +16 -20
  62. data/lib/vedeu/views/streams.rb +15 -0
  63. data/lib/vedeu/{models/views → views}/view.rb +28 -17
  64. data/lib/vedeu/views/view_collection.rb +15 -0
  65. data/lib/vedeu.rb +2 -0
  66. data/test/lib/vedeu/borders/set_attribute_test.rb +62 -0
  67. data/test/lib/vedeu/common_test.rb +6 -0
  68. data/test/lib/vedeu/cursors/cursor_test.rb +0 -8
  69. data/test/lib/vedeu/cursors/move_test.rb +73 -0
  70. data/test/lib/vedeu/cursors/repository_test.rb +3 -1
  71. data/test/lib/vedeu/dsl/lines_test.rb +12 -0
  72. data/test/lib/vedeu/dsl/streams_test.rb +13 -0
  73. data/test/lib/vedeu/events/aliases_test.rb +4 -4
  74. data/test/lib/vedeu/groups/refresh_test.rb +0 -6
  75. data/test/lib/vedeu/input/store_test.rb +2 -2
  76. data/test/lib/vedeu/interfaces/interface_test.rb +6 -1
  77. data/test/lib/vedeu/models/focus_test.rb +25 -10
  78. data/test/lib/vedeu/models/page_test.rb +6 -0
  79. data/test/lib/vedeu/models/row_test.rb +12 -0
  80. data/test/lib/vedeu/presentation/background_test.rb +72 -0
  81. data/test/lib/vedeu/presentation/colour_test.rb +67 -0
  82. data/test/lib/vedeu/presentation/foreground_test.rb +73 -0
  83. data/test/lib/vedeu/{output/presentation → presentation}/presentation_test.rb +0 -0
  84. data/test/lib/vedeu/{output/presentation → presentation}/style_test.rb +0 -0
  85. data/test/lib/vedeu/{output/presentation → presentation}/styles_test.rb +7 -9
  86. data/test/lib/vedeu/{output/renderers → renderers}/all_test.rb +3 -2
  87. data/test/lib/vedeu/{output/renderers → renderers}/file_test.rb +0 -0
  88. data/test/lib/vedeu/{output/renderers → renderers}/html_test.rb +2 -1
  89. data/test/lib/vedeu/{output/renderers → renderers}/json_test.rb +1 -0
  90. data/test/lib/vedeu/{output/renderers → renderers}/options_test.rb +10 -6
  91. data/test/lib/vedeu/{output/renderers → renderers}/terminal_test.rb +0 -0
  92. data/test/lib/vedeu/repositories/repositories_test.rb +1 -0
  93. data/test/lib/vedeu/runtime/flags_test.rb +2 -0
  94. data/test/lib/vedeu/templating/helpers_test.rb +15 -6
  95. data/test/lib/vedeu/{models/views → views}/char_test.rb +0 -0
  96. data/test/lib/vedeu/{models/views → views}/composition_test.rb +0 -0
  97. data/test/lib/vedeu/{models/views → views}/html_char_test.rb +0 -0
  98. data/test/lib/vedeu/{models/views → views}/line_test.rb +6 -1
  99. data/test/lib/vedeu/views/lines_test.rb +13 -0
  100. data/test/lib/vedeu/{models/views → views}/stream_test.rb +6 -1
  101. data/test/lib/vedeu/views/streams_test.rb +13 -0
  102. data/test/lib/vedeu/views/view_collection_test.rb +13 -0
  103. data/test/lib/vedeu/{models/views → views}/view_test.rb +6 -1
  104. data/test/support/examples/material_colours_app.rb +1 -1
  105. data/test/support/helpers/presentation_colour_test_class.rb +29 -0
  106. data/test/test_helper.rb +4 -0
  107. metadata +84 -56
  108. data/lib/vedeu/models/views/all.rb +0 -16
  109. data/lib/vedeu/null/view.rb +0 -26
  110. data/lib/vedeu/output/presentation/all.rb +0 -15
  111. data/lib/vedeu/output/presentation/colour.rb +0 -100
  112. data/lib/vedeu/output/presentation/styles.rb +0 -42
  113. data/test/lib/vedeu/null/view_test.rb +0 -31
  114. data/test/lib/vedeu/output/presentation/colour_test.rb +0 -172
@@ -17,14 +17,14 @@ module Vedeu
17
17
  before do
18
18
  Vedeu.stubs(:log)
19
19
 
20
- described.reset
21
- Vedeu.interfaces.reset
20
+ described.reset!
21
+ Vedeu.interfaces.reset!
22
22
 
23
23
  Vedeu.stubs(:trigger)
24
24
  end
25
25
  after do
26
- described.reset
27
- Vedeu.interfaces.reset
26
+ described.reset!
27
+ Vedeu.interfaces.reset!
28
28
  end
29
29
 
30
30
  describe '#add' do
@@ -101,7 +101,7 @@ module Vedeu
101
101
  end
102
102
 
103
103
  describe '#current' do
104
- before { described.reset }
104
+ before { described.reset! }
105
105
 
106
106
  subject { described.current }
107
107
 
@@ -113,7 +113,7 @@ module Vedeu
113
113
  end
114
114
 
115
115
  context 'when no interfaces are defined' do
116
- it { proc { subject }.must_raise(Vedeu::Error::Fatal) }
116
+ it { subject.must_equal(nil) }
117
117
  end
118
118
 
119
119
  context 'API methods' do
@@ -148,6 +148,21 @@ module Vedeu
148
148
  end
149
149
  end
150
150
 
151
+ describe '#focus?' do
152
+ context 'when there are no interfaces defined' do
153
+ before { described.reset! }
154
+
155
+ it { described.focus?.must_equal(false) }
156
+ end
157
+
158
+ context 'when there are interfaces defined' do
159
+ before { described.add('thallium') }
160
+ after { described.reset! }
161
+
162
+ it { described.focus?.must_equal(true) }
163
+ end
164
+ end
165
+
151
166
  describe '#next_item' do
152
167
  it 'the next interface is focussed when the method is called' do
153
168
  described.add('thallium')
@@ -157,7 +172,7 @@ module Vedeu
157
172
  end
158
173
 
159
174
  context 'returns false if storage is empty' do
160
- before { described.reset }
175
+ before { described.reset! }
161
176
 
162
177
  it { described.next_item.must_equal(false) }
163
178
  end
@@ -188,7 +203,7 @@ module Vedeu
188
203
  end
189
204
 
190
205
  context 'when there are no interfaces' do
191
- before { described.reset }
206
+ before { described.reset! }
192
207
 
193
208
  it { described.next_visible_item.must_equal(false) }
194
209
  end
@@ -203,7 +218,7 @@ module Vedeu
203
218
  end
204
219
 
205
220
  context 'returns false if storage is empty' do
206
- before { described.reset }
221
+ before { described.reset! }
207
222
 
208
223
  it { described.prev_item.must_equal(false) }
209
224
  end
@@ -235,7 +250,7 @@ module Vedeu
235
250
  end
236
251
 
237
252
  context 'when there are no interfaces' do
238
- before { described.reset }
253
+ before { described.reset! }
239
254
 
240
255
  it { described.prev_visible_item.must_equal(false) }
241
256
  end
@@ -275,6 +275,12 @@ module Vedeu
275
275
  end
276
276
  end
277
277
 
278
+ describe '#size' do
279
+ subject { instance.size }
280
+
281
+ it { subject.must_be_instance_of(Fixnum) }
282
+ end
283
+
278
284
  end # Page
279
285
 
280
286
  end # Models
@@ -144,6 +144,18 @@ module Vedeu
144
144
  end
145
145
  end
146
146
 
147
+ describe '#reset_character' do
148
+ subject { instance.reset_character }
149
+
150
+ it { subject.must_be_instance_of(Vedeu::Views::Char) }
151
+ end
152
+
153
+ describe '#size' do
154
+ subject { instance.size }
155
+
156
+ it { subject.must_be_instance_of(Fixnum) }
157
+ end
158
+
147
159
  end # Row
148
160
 
149
161
  end # Models
@@ -0,0 +1,72 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ module Presentation
6
+
7
+ module Colour
8
+
9
+ describe Background do
10
+
11
+ let(:includer) { Vedeu::PresentationColourTestClass.new(attributes) }
12
+ let(:attributes) {
13
+ {
14
+ colour: colour,
15
+ parent: parent
16
+ }
17
+ }
18
+ let(:colour) {
19
+ {
20
+ background: background,
21
+ foreground: foreground
22
+ }
23
+ }
24
+ let(:background) { '#000033' }
25
+ let(:foreground) { '#aadd00' }
26
+ let(:parent) { Vedeu::ParentPresentationColourTestClass.new }
27
+
28
+ describe '#background' do
29
+ subject { includer.background }
30
+
31
+ it { subject.must_be_instance_of(Vedeu::Colours::Background) }
32
+
33
+ context 'when a colour is not set' do
34
+ let(:colour) {}
35
+
36
+ context 'when a parent is not available' do
37
+ let(:parent) {}
38
+
39
+ it { subject.colour.must_equal('') }
40
+ end
41
+
42
+ context 'when a parent is available' do
43
+ it { subject.colour.must_equal('#330000') }
44
+ end
45
+ end
46
+
47
+ context 'when a colour is set' do
48
+ it { subject.colour.must_equal('#000033') }
49
+ end
50
+
51
+ # @todo Add more tests.
52
+ end
53
+
54
+ describe '#background=' do
55
+ subject { includer.background = '#987654' }
56
+
57
+ it {
58
+ includer.colour.background.colour.must_equal('#000033')
59
+ subject
60
+ includer.colour.background.colour.must_equal('#987654')
61
+ }
62
+
63
+ it { subject.must_equal('#987654') }
64
+ end
65
+
66
+ end # Background
67
+
68
+ end # Colour
69
+
70
+ end # Presentation
71
+
72
+ end # Vedeu
@@ -0,0 +1,67 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ module Presentation
6
+
7
+ describe Colour do
8
+
9
+ let(:includer) { Vedeu::PresentationColourTestClass.new(attributes) }
10
+ let(:attributes) {
11
+ {
12
+ colour: colour,
13
+ parent: parent
14
+ }
15
+ }
16
+ let(:colour) {
17
+ {
18
+ background: background,
19
+ foreground: foreground
20
+ }
21
+ }
22
+ let(:background) { '#000033' }
23
+ let(:foreground) { '#aadd00' }
24
+ let(:parent) { Vedeu::ParentPresentationColourTestClass.new }
25
+
26
+ describe '#colour' do
27
+ subject { includer.colour }
28
+
29
+ it { subject.must_be_instance_of(Vedeu::Colours::Colour) }
30
+
31
+ context 'when a colour is not set' do
32
+ let(:colour) {}
33
+
34
+ context 'when a parent is not available' do
35
+ let(:parent) {}
36
+
37
+ it { subject.background.colour.must_equal('') }
38
+ it { subject.foreground.colour.must_equal('') }
39
+ end
40
+
41
+ context 'when a parent is available' do
42
+ it { subject.background.colour.must_equal('#330000') }
43
+ it { subject.foreground.colour.must_equal('#00aadd') }
44
+ end
45
+ end
46
+
47
+ context 'when a colour is set' do
48
+ it { subject.background.colour.must_equal('#000033') }
49
+ it { subject.foreground.colour.must_equal('#aadd00') }
50
+ end
51
+ end
52
+
53
+ describe '#colour=' do
54
+ let(:colour) {
55
+ Vedeu::Colours::Colour.new(foreground: '#00ff00', background: '#000000')
56
+ }
57
+
58
+ subject { includer.colour=(colour) }
59
+
60
+ it { subject.must_be_instance_of(Vedeu::Colours::Colour) }
61
+ end
62
+
63
+ end # Colour
64
+
65
+ end # Presentation
66
+
67
+ end # Vedeu
@@ -0,0 +1,73 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ module Presentation
6
+
7
+ module Colour
8
+
9
+ describe Foreground do
10
+
11
+ let(:includer) { Vedeu::PresentationColourTestClass.new(attributes) }
12
+ let(:attributes) {
13
+ {
14
+ colour: colour,
15
+ parent: parent
16
+ }
17
+ }
18
+ let(:colour) {
19
+ {
20
+ background: background,
21
+ foreground: foreground
22
+ }
23
+ }
24
+ let(:background) { '#000033' }
25
+ let(:foreground) { '#aadd00' }
26
+ let(:parent) { Vedeu::ParentPresentationColourTestClass.new }
27
+
28
+ describe '#foreground' do
29
+ subject { includer.foreground }
30
+
31
+ it { subject.must_be_instance_of(Vedeu::Colours::Foreground) }
32
+ it { subject.colour.must_equal('#aadd00') }
33
+
34
+ context 'when a colour is not set' do
35
+ let(:colour) {}
36
+
37
+ context 'when a parent is not available' do
38
+ let(:parent) {}
39
+
40
+ it { subject.colour.must_equal('') }
41
+ end
42
+
43
+ context 'when a parent is available' do
44
+ it { subject.colour.must_equal('#00aadd') }
45
+ end
46
+ end
47
+
48
+ context 'when a colour is set' do
49
+ it { subject.colour.must_equal('#aadd00') }
50
+ end
51
+
52
+ # @todo Add more tests.
53
+ end
54
+
55
+ describe '#foreground=' do
56
+ subject { includer.foreground = '#123456' }
57
+
58
+ it {
59
+ includer.colour.foreground.colour.must_equal('#aadd00')
60
+ subject
61
+ includer.colour.foreground.colour.must_equal('#123456')
62
+ }
63
+
64
+ it { subject.must_equal('#123456') }
65
+ end
66
+
67
+ end # Foreground
68
+
69
+ end # Colour
70
+
71
+ end # Presentation
72
+
73
+ end # Vedeu
@@ -6,26 +6,24 @@ module Vedeu
6
6
 
7
7
  include Vedeu::Presentation
8
8
 
9
- attr_reader :parent
9
+ attr_reader :style
10
10
 
11
- def attributes
12
- {
13
- style: ['underline']
14
- }
11
+ def initialize
12
+ @style = ['underline']
13
+ @parent = nil
15
14
  end
16
15
 
17
- end
16
+ end # ParentPresentationStyleTestClass
18
17
 
19
18
  class PresentationStyleTestClass
20
19
 
21
20
  include Vedeu::Presentation
22
21
 
23
- attr_reader :attributes
24
22
  attr_reader :parent
25
23
 
26
24
  def initialize(attributes = {})
27
- @attributes = attributes
28
- @parent = @attributes[:parent]
25
+ @style = attributes[:style]
26
+ @parent = attributes[:parent]
29
27
  end
30
28
 
31
29
  end # PresentationTestClass
@@ -128,9 +128,10 @@ module Vedeu
128
128
  end
129
129
  end
130
130
 
131
- describe '.reset' do
132
- subject { described.reset }
131
+ describe '.reset!' do
132
+ subject { described.reset! }
133
133
 
134
+ it { described.must_respond_to(:reset) }
134
135
  it { subject.must_be_instance_of(Set) }
135
136
  it { subject.size.must_equal(0) }
136
137
  end
@@ -28,13 +28,14 @@ module Vedeu
28
28
  let(:start_tag) { '<td' }
29
29
  let(:start_row_tag) { '<tr>' }
30
30
  let(:template) {
31
- ::File.dirname(__FILE__) + '/../../../../support/templates/html_renderer.vedeu'
31
+ ::File.dirname(__FILE__) + '/../../../support/templates/html_renderer.vedeu'
32
32
  }
33
33
  let(:timestamp) { false }
34
34
  let(:write_file) { false }
35
35
  let(:buffer) { Vedeu::Buffers::Terminal }
36
36
 
37
37
  before do
38
+ Vedeu::Configuration.stubs(:compression?).returns(false)
38
39
  ::File.stubs(:write)
39
40
  Vedeu.stubs(:height).returns(2)
40
41
  Vedeu.stubs(:width).returns(4)
@@ -13,6 +13,7 @@ module Vedeu
13
13
  let(:_name) { 'Vedeu::Renderers::JSON' }
14
14
 
15
15
  before do
16
+ Vedeu::Configuration.stubs(:compression?).returns(false)
16
17
  ::File.stubs(:write)
17
18
  Vedeu.stubs(:height).returns(1)
18
19
  Vedeu.stubs(:width).returns(1)
@@ -30,16 +30,20 @@ module Vedeu
30
30
  describe '#compress?' do
31
31
  subject { instance.compress? }
32
32
 
33
- context 'when the option is not set' do
33
+ context 'when the option is not set or is set to false' do
34
34
  before { options.tap { |o| o.delete(:compression) } }
35
35
 
36
- it { subject.must_equal(false) }
37
- end
36
+ context 'when Vedeu::Configuration.compression? is set to false' do
37
+ before { Vedeu::Configuration.stubs(:compression?).returns(false) }
38
+
39
+ it { subject.must_equal(false) }
40
+ end
38
41
 
39
- context 'when the option is set and is false' do
40
- let(:compression) { false }
42
+ context 'when Vedeu::Configuration.compression? is set to true' do
43
+ before { Vedeu::Configuration.stubs(:compression?).returns(true) }
41
44
 
42
- it { subject.must_equal(false) }
45
+ it { subject.must_equal(true) }
46
+ end
43
47
  end
44
48
 
45
49
  context 'when the option is set and is true' do
@@ -43,6 +43,7 @@ module Vedeu
43
43
  describe '.reset!' do
44
44
  subject { described.reset! }
45
45
 
46
+ it { described.must_respond_to(:reset) }
46
47
  it { subject.must_equal(true) }
47
48
  end
48
49
 
@@ -42,10 +42,12 @@ module Vedeu
42
42
  subject
43
43
  described.ready?.must_equal(false)
44
44
  }
45
+ it { described.instance.must_respond_to(:reset) }
45
46
  end
46
47
 
47
48
  describe '#reset!' do
48
49
  it { described.instance.must_respond_to(:reset!) }
50
+ it { described.instance.must_respond_to(:reset) }
49
51
  end
50
52
 
51
53
  end # Flags
@@ -17,7 +17,7 @@ module Vedeu
17
17
 
18
18
  describe '#background' do
19
19
  let(:expected) {
20
- "{{eJxdj0+LwjAQxT1I6poqy7IX8aDUL+B5ehlYXOhNULynOkqxbSSZ+If98sZ0q+BcMsObN7+Xbk/DaEM7cgCbgi4WYMWGVBXDJypmU+SOyf5JkNuyoJrnvtGldkbD+N/3E2bbNpF35mp7PBjt6l2WxLN5KAFisfbaXhtqNA2T9xO/T1FAjA0pSzoilWuQJ2VCgr7lW0kv99KQ9YLiQteP/F4UIPGsSkd+O7xZ8v0KNWW6crj5UauKWoAHNn9Mhxj5qeVJDECU6RfG0MeHBwd3NqRjxg==}}"
20
+ "{{eJxdjk8LgkAUxDvEGuqhoEt0KOwLeH5eFqLAW5B43/QV0rov1t3+fPtWy4TmNMNvGGY8IVjkWKIFyCt8NABHo1HUAYS8kBUqE7eOJFlNsPxWt11ueuPBlJ9Ecb1osqpMo3ATd2LAdpljZ9L4YQSr/4n9D7LES6MRS/wMfK5EjX0K+U3o7krAG/OSOMwcNDaOCFORar87yFzrLqTFOJml0Xw4tjb4NO3gG3z2TbI=}}"
21
21
  }
22
22
 
23
23
  subject { instance.background('#000000') { 'background text' } }
@@ -43,7 +43,16 @@ module Vedeu
43
43
  }
44
44
  }
45
45
  let(:expected) {
46
- "{{eJxdj0GLAjEMhT1Ide0osjfxoIx/oHjMXAKLC3MTVrxXjTI4TqVNXcU/v7Wzo+ApCV/ee0m7a2C0ph15gHVBvw7ghy3pUwJD1My22Hgmd5cgt2VBFavQmNJ4a2D8r/uKs2uaTlBu9PZ4sMZXuzxNZkrN50oJEItVYHtjqWYGJu8W308oIME6KU9bIpMrkGdt4wU9x7eSXuqlJReA5sJUj/sDFCDxoktPYTvWPB3WblOmK0e/j0qfqDEPYfV/2QA7YWqyJMYwlNknJtDDhwb7f4vpYjo=}}"
46
+ "{{eJxdjs0KgkAYRVvEGOrCltGisBcYXH5uBqLAXZC4n/QrpNGJ+enn7Rs1C9rdy7kc7nQmYVFghRagqPGhAY5GIW8CCFkpamwN7ZIU0ioJy89023c9Bg8iduLl9aKkbassDjeUJgmlBMgud+wsFQ5Mwupfsf9CknpZPCGpn4PPWt7g2EJ246q/EjBtXgJ/moNC7Qg3tWy77w4St7pzYZGm8yyOhu9rg0/Tyd5Hdkwm}}"
47
+ }
48
+ let(:expected_decoded) {
49
+ Vedeu::Views::Stream.new(
50
+ client: nil,
51
+ colour: Vedeu::Colours::Colour.coerce(attributes),
52
+ name: '',
53
+ parent: nil,
54
+ style: Vedeu::Presentation::Style.new,
55
+ value: 'colour text')
47
56
  }
48
57
 
49
58
  it { subject.must_equal(expected) }
@@ -56,7 +65,7 @@ module Vedeu
56
65
  }
57
66
  }
58
67
  let(:expected) {
59
- "{{eJxdTz1vwjAQ7VCZgo2E2BBDq/QPZL4sp1YM2ZBA7AYuVdQkruxzW8Sf5+IAlerF9/Tufdzjk4PFjo4UAXY1/QSADXuyrYEZWmZf7yNTOGvQh6amjnMZXOOid7C86t4TDrdhJMq9PXx+eBe7o4Pn/2tvd1KBwcGtzB4UqNVWtJXzNNBlZl6rKpeniukW9Jf1qcEk8KmhP+e1pyCE5dp1fX8hFWj8tk0k2U5/mc2GpBemX05+48621Af3QIoM9xUGR4JuWRpTGOpijgYm2GtwegEm12KL}}"
68
+ "{{eJxdjrsOwjAMRRlQimiHMiIGUPmBzu4SgRi6IVF1D9RFFWmMkpTH35O0PCQ8Xfse23c8IZiXWGEHUDZ4NwAHq1G0IUT8JBtUNvWKJHWaYPFGt31vPiKAmB/F6XLW1KmKYPmPbb4my4I8GTFgu8It1aRxmOdJtK7r1BXLwgKmXIkWPem7iF+F7qOE3NinxN+LvUbjHGEbUj67M5mjbkJ2mGazPImH7CuLD+uPvQC3X0x2}}"
60
69
  }
61
70
 
62
71
  it { subject.must_equal(expected) }
@@ -70,7 +79,7 @@ module Vedeu
70
79
  }
71
80
  }
72
81
  let(:expected) {
73
- "{{eJxFTj0LwkAMdZCqvQ5dxUHRP1BcCnEJiIOboLifmkqx7cldzg/888bTYpa85OXlvW7fwHBPJ/IA+5LuDmDLlnSdQIqa2ZYHz+ReCtSxKqnhTICpjLcGRj/dMsyuBT1RHvTxcrbGN6f1NJllUvN5BNFqJ1xhLP25osjzLIsWagfqqm1wiB0/KzIw/hlsLDkhNJem+eQTMgKFN115kuvQ19P0m2vC9ODwb9DoWvadMCTY5hcUDrEnsLVUGDwxXqSoIMaPFJM3E8dZBA==}}"
82
+ "{{eJxFjjsLwkAQhC0kSpIirVgo8Q8caQKb5kAs0gmG9KfZSPByK/fw8e+9xIhbzfANOzNfEqxqbNAB1B0+DcDJahR9BDG/yA6VZYMiSU4TrKfofvTmJxaQ8LO43K6anGrKNN4xf1kWQHCoPGtJ45+1bZ4zFhRhBSFXoscynY0u5nehx8aIG/uWSLCZCo8ajSfCdqSGiR4GPvUQ0iErkjJNvhO3Fl92ePYBmEpC+w==}}"
74
83
  }
75
84
 
76
85
  it { subject.must_equal(expected) }
@@ -79,7 +88,7 @@ module Vedeu
79
88
 
80
89
  describe '#foreground' do
81
90
  let(:expected) {
82
- "{{eJxdT02LwjAQ9SDRNSmIeFk8rNQ/0PP0MigeeltY8R51lGJtJJnsKv5509QP2FwyjzfvY7p9A59r2pEHWJf05wB+2JI+KRiiZrblxjO5mwS5rUqqOQuDqYy3BiYP3SJi9xx6QbnR2+PBGl/vDHz9X5u/SAEKW7ci7QgQy1XQ7o2lli5SNcviE3myAnnWNjYYOL5W9Hb+tuQCobk0ddM/kAIk/urKU9iOf5GO38ZTpgtHz49an6gJb0Ao096YK+wF9MyTGANR5iNUMMBGg8kdnYZjyg==}}"
91
+ "{{eJxdTrsOwjAMZEApoh1AYkEMoPIDnd0lAjF0Q6LqHlqDKtIYpQmPvycpj0p4uvOdfTccEcwLrNACFDXeW4CD0SiaECJeyhqVSTwiSVYTLD7WbcfbLwhgwo+ivJw1WVURLP9tm5/I0iCLBwzYLndHJ9L43mdxtE66YWmYw5gr0aB3ehbxq9BdlZC35imxj9hrbJ0iTE3Kd3cic66bkBaTdJrFsz5jZfBh/MMXxlpNtQ==}}"
83
92
  }
84
93
 
85
94
  subject { instance.foreground('#000000') { 'foreground text' } }
@@ -91,7 +100,7 @@ module Vedeu
91
100
 
92
101
  describe '#style' do
93
102
  let(:expected) {
94
- "{{eJx1kD9vAjEMxRlQCneB0oEBdSjiE3R2lghUJLZKRew5zlSnhjNKnALqlycX/kmV2J7z/Hu20+4QjFZYYgBYVbj3AF/s0GwlDLRhdlURGP1fDvnaVljzexRkKTiC1ws3S7W/ik4kC7P++XYU6pLg7X/b9GYKkPqctpi0BIiPZWQ35PAhO7+ZQskGUr0l5Nrz0SJ0C7Il5Dvj0qJZer2HfDr00TBcUd2cGU0R2V9jA6oXyJJYTJ4TNmY8cErv1maL11Fx3/M3KKmfYnWZpQZaqqHuQaabbt0/AcA1bbY=}}"
103
+ "{{eJx1j08LgkAQxTuEWUoGnaJD4SfoPHtZigJvQeJ91SmkdSfWtT/fPle0IOj2Zt57P2aGLsEiwRxrgKTARwVwMhpF6YHPM1mgMhurSFKtCZZddNfOVS9cmPFUZNeLplrlBKvf2PZjOmwUhQMHnH3clM6k8W/p8DG7EvNi8HhlXhJhnJLMYcKVKLH3fH4T2l7Mpl/cUWPV7IQpSNnnmrLTUO5C1sgCNo/CoCWuDT6NxbwBBzVXlA==}}"
95
104
  }
96
105
 
97
106
  subject { instance.style(:bold) { 'style text' } }
File without changes
@@ -71,7 +71,6 @@ module Vedeu
71
71
 
72
72
  describe 'accessors' do
73
73
  it {
74
- instance.must_respond_to(:attributes)
75
74
  instance.must_respond_to(:parent)
76
75
  instance.must_respond_to(:parent=)
77
76
  }
@@ -84,6 +83,12 @@ module Vedeu
84
83
  it { instance.must_respond_to(:<<) }
85
84
  end
86
85
 
86
+ describe '#attributes' do
87
+ subject { instance.attributes }
88
+
89
+ it { subject.must_be_instance_of(Hash) }
90
+ end
91
+
87
92
  describe '#chars' do
88
93
  subject { instance.chars }
89
94
 
@@ -0,0 +1,13 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ module Views
6
+
7
+ describe Lines do
8
+
9
+ end # Lines
10
+
11
+ end # Views
12
+
13
+ end # Vedeu
@@ -59,7 +59,6 @@ module Vedeu
59
59
  instance.must_respond_to(:content)
60
60
  instance.must_respond_to(:text)
61
61
  instance.must_respond_to(:value=)
62
- instance.must_respond_to(:attributes)
63
62
  }
64
63
  end
65
64
 
@@ -73,6 +72,12 @@ module Vedeu
73
72
  it { instance.must_respond_to(:<<) }
74
73
  end
75
74
 
75
+ describe '#attributes' do
76
+ subject { instance.attributes }
77
+
78
+ it { subject.must_be_instance_of(Hash) }
79
+ end
80
+
76
81
  describe '#chars' do
77
82
  subject { instance.chars }
78
83
 
@@ -0,0 +1,13 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ module Views
6
+
7
+ describe Streams do
8
+
9
+ end # Streams
10
+
11
+ end # Views
12
+
13
+ end # Vedeu
@@ -0,0 +1,13 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ module Views
6
+
7
+ describe ViewCollection do
8
+
9
+ end # ViewCollection
10
+
11
+ end # Views
12
+
13
+ end # Vedeu
@@ -30,7 +30,6 @@ module Vedeu
30
30
 
31
31
  describe 'accessors' do
32
32
  it {
33
- instance.must_respond_to(:attributes)
34
33
  instance.must_respond_to(:client)
35
34
  instance.must_respond_to(:client=)
36
35
  instance.must_respond_to(:cursor_visible)
@@ -54,6 +53,12 @@ module Vedeu
54
53
  # it { skip }
55
54
  end
56
55
 
56
+ describe '#attributes' do
57
+ subject { instance.attributes }
58
+
59
+ it { subject.must_be_instance_of(Hash) }
60
+ end
61
+
57
62
  describe '#deputy' do
58
63
  subject { instance.deputy }
59
64
 
@@ -287,7 +287,7 @@ class VedeuMaterialColoursApp
287
287
  message: "Keypresses: #{Vedeu.all_keypresses.inspect}")
288
288
  end
289
289
 
290
- key('q') { Vedeu.trigger(:_exit_) }
290
+ key('q', :ctrl_c) { Vedeu.trigger(:_exit_) }
291
291
  # key(:escape) { Vedeu.trigger(:_mode_switch_, :fake) }
292
292
  key(:f1) { Vedeu.trigger(:_mode_switch_, :fake) }
293
293
  key(:f2) { Vedeu.trigger(:_mode_switch_, :raw) }