vedeu 0.4.18 → 0.4.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (159) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -1
  3. data/Rakefile +1 -0
  4. data/bin/vedeu_drb_server +0 -1
  5. data/bin/vedeu_test +0 -1
  6. data/config/rubocop_enabled.yml +1 -1
  7. data/examples/borders_app.rb +0 -1
  8. data/examples/colours_app.rb +0 -1
  9. data/examples/cursor_app.rb +0 -1
  10. data/examples/drb_app.rb +0 -1
  11. data/examples/geometry_app.rb +0 -1
  12. data/examples/hello_world.rb +0 -1
  13. data/examples/lines_app.rb +0 -1
  14. data/examples/material_colours_app.rb +0 -1
  15. data/examples/typed_commands/typed_commands_app.rb +0 -1
  16. data/examples/view_templates_app/view_templates_app.rb +0 -1
  17. data/lib/vedeu/api.rb +2 -1
  18. data/lib/vedeu/application.rb +3 -2
  19. data/lib/vedeu/bindings.rb +3 -5
  20. data/lib/vedeu/buffers/buffer.rb +8 -11
  21. data/lib/vedeu/buffers/display_buffer.rb +0 -2
  22. data/lib/vedeu/configuration/api.rb +1 -4
  23. data/lib/vedeu/configuration/cli.rb +153 -74
  24. data/lib/vedeu/configuration/configuration.rb +1 -2
  25. data/lib/vedeu/cursor/cursor.rb +0 -4
  26. data/lib/vedeu/cursor/move.rb +3 -6
  27. data/lib/vedeu/cursor/refresh_cursor.rb +12 -2
  28. data/lib/vedeu/distributed/client.rb +3 -2
  29. data/lib/vedeu/distributed/server.rb +4 -3
  30. data/lib/vedeu/distributed/subprocess.rb +3 -4
  31. data/lib/vedeu/distributed/test_application.rb +0 -1
  32. data/lib/vedeu/distributed/uri.rb +0 -1
  33. data/lib/vedeu/dsl/components/border.rb +3 -4
  34. data/lib/vedeu/dsl/components/geometry.rb +1 -5
  35. data/lib/vedeu/dsl/components/keymap.rb +1 -3
  36. data/lib/vedeu/dsl/components/menu.rb +1 -2
  37. data/lib/vedeu/dsl/composition.rb +3 -4
  38. data/lib/vedeu/dsl/group.rb +1 -4
  39. data/lib/vedeu/dsl/interface.rb +3 -10
  40. data/lib/vedeu/dsl/line.rb +3 -4
  41. data/lib/vedeu/dsl/shared/text.rb +0 -3
  42. data/lib/vedeu/dsl/stream.rb +3 -4
  43. data/lib/vedeu/dsl/view.rb +0 -3
  44. data/lib/vedeu/events/event.rb +3 -3
  45. data/lib/vedeu/events/trigger.rb +3 -2
  46. data/lib/vedeu/geometry/area.rb +0 -1
  47. data/lib/vedeu/geometry/canvas.rb +0 -1
  48. data/lib/vedeu/geometry/coordinate.rb +6 -7
  49. data/lib/vedeu/geometry/dimension.rb +3 -2
  50. data/lib/vedeu/geometry/geometry.rb +0 -6
  51. data/lib/vedeu/geometry/grid.rb +3 -2
  52. data/lib/vedeu/geometry/index_position.rb +0 -1
  53. data/lib/vedeu/geometry/position.rb +0 -1
  54. data/lib/vedeu/geometry/position_index.rb +0 -1
  55. data/lib/vedeu/geometry/position_validator.rb +6 -68
  56. data/lib/vedeu/input/all.rb +0 -2
  57. data/lib/vedeu/input/input.rb +3 -2
  58. data/lib/vedeu/input/key.rb +0 -1
  59. data/lib/vedeu/input/keymap.rb +4 -7
  60. data/lib/vedeu/input/mapper.rb +3 -2
  61. data/lib/vedeu/launcher.rb +3 -2
  62. data/lib/vedeu/main_loop.rb +1 -1
  63. data/lib/vedeu/models/cell.rb +0 -1
  64. data/lib/vedeu/models/char.rb +0 -1
  65. data/lib/vedeu/models/composition.rb +1 -7
  66. data/lib/vedeu/models/group.rb +0 -3
  67. data/lib/vedeu/models/interface.rb +0 -3
  68. data/lib/vedeu/models/line.rb +0 -4
  69. data/lib/vedeu/models/menu.rb +5 -8
  70. data/lib/vedeu/models/stream.rb +0 -4
  71. data/lib/vedeu/null/all.rb +11 -0
  72. data/lib/vedeu/null/border.rb +3 -1
  73. data/lib/vedeu/null/buffer.rb +0 -1
  74. data/lib/vedeu/null/generic.rb +4 -1
  75. data/lib/vedeu/null/geometry.rb +0 -1
  76. data/lib/vedeu/null/interface.rb +36 -7
  77. data/lib/vedeu/output/background.rb +0 -1
  78. data/lib/vedeu/output/border.rb +1 -6
  79. data/lib/vedeu/output/clear.rb +3 -2
  80. data/lib/vedeu/output/colour.rb +6 -18
  81. data/lib/vedeu/output/compressor.rb +5 -2
  82. data/lib/vedeu/output/esc.rb +4 -1
  83. data/lib/vedeu/output/foreground.rb +0 -5
  84. data/lib/vedeu/output/html_char.rb +3 -2
  85. data/lib/vedeu/output/output.rb +1 -5
  86. data/lib/vedeu/output/refresh.rb +1 -1
  87. data/lib/vedeu/output/renderers/all.rb +0 -1
  88. data/lib/vedeu/output/renderers/escape_sequence.rb +3 -2
  89. data/lib/vedeu/output/renderers/file.rb +85 -80
  90. data/lib/vedeu/output/renderers/html.rb +77 -72
  91. data/lib/vedeu/output/renderers/json.rb +45 -42
  92. data/lib/vedeu/output/renderers/null.rb +11 -8
  93. data/lib/vedeu/output/renderers/terminal.rb +41 -36
  94. data/lib/vedeu/output/renderers/text.rb +41 -36
  95. data/lib/vedeu/output/style.rb +0 -3
  96. data/lib/vedeu/output/text.rb +3 -2
  97. data/lib/vedeu/output/viewport.rb +3 -2
  98. data/lib/vedeu/output/virtual_terminal.rb +0 -1
  99. data/lib/vedeu/output/wordwrap.rb +3 -2
  100. data/lib/vedeu/repositories/all.rb +7 -6
  101. data/lib/vedeu/repositories/collection.rb +0 -1
  102. data/lib/vedeu/repositories/collections/chars.rb +0 -1
  103. data/lib/vedeu/repositories/collections/events.rb +0 -1
  104. data/lib/vedeu/repositories/collections/interfaces.rb +0 -1
  105. data/lib/vedeu/repositories/collections/keys.rb +0 -1
  106. data/lib/vedeu/repositories/collections/lines.rb +0 -1
  107. data/lib/vedeu/repositories/collections/streams.rb +0 -1
  108. data/lib/vedeu/repositories/model.rb +0 -1
  109. data/lib/vedeu/repositories/registerable.rb +29 -0
  110. data/lib/vedeu/repositories/repositories/background_colours.rb +0 -1
  111. data/lib/vedeu/repositories/repositories/borders.rb +2 -13
  112. data/lib/vedeu/repositories/repositories/buffers.rb +2 -13
  113. data/lib/vedeu/repositories/repositories/colours.rb +0 -1
  114. data/lib/vedeu/repositories/repositories/cursors.rb +1 -2
  115. data/lib/vedeu/repositories/repositories/events_repository.rb +0 -1
  116. data/lib/vedeu/repositories/repositories/foreground_colours.rb +0 -1
  117. data/lib/vedeu/repositories/repositories/geometries.rb +2 -13
  118. data/lib/vedeu/repositories/repositories/groups.rb +1 -2
  119. data/lib/vedeu/repositories/repositories/interfaces_repository.rb +2 -14
  120. data/lib/vedeu/repositories/repositories/keymaps.rb +1 -2
  121. data/lib/vedeu/repositories/repositories/menus.rb +1 -2
  122. data/lib/vedeu/repositories/repository.rb +14 -5
  123. data/lib/vedeu/storage/all.rb +0 -1
  124. data/lib/vedeu/storage/associative_store.rb +0 -1
  125. data/lib/vedeu/storage/conveyor_store.rb +0 -1
  126. data/lib/vedeu/storage/fifo_store.rb +0 -1
  127. data/lib/vedeu/support/log.rb +0 -3
  128. data/lib/vedeu/support/options.rb +3 -2
  129. data/lib/vedeu/support/template.rb +3 -4
  130. data/lib/vedeu/support/terminal.rb +0 -2
  131. data/lib/vedeu/support/trace.rb +6 -7
  132. data/lib/vedeu/support/visibility.rb +1 -2
  133. data/lib/vedeu.rb +3 -5
  134. data/test/lib/vedeu/buffers/buffer_test.rb +48 -13
  135. data/test/lib/vedeu/configuration/cli_test.rb +5 -4
  136. data/test/lib/vedeu/cursor/refresh_cursor_test.rb +37 -15
  137. data/test/lib/vedeu/distributed/subprocess_test.rb +1 -0
  138. data/test/lib/vedeu/dsl/shared/use_test.rb +1 -6
  139. data/test/lib/vedeu/main_loop_test.rb +11 -0
  140. data/test/lib/vedeu/null/interface_test.rb +27 -0
  141. data/test/lib/vedeu/output/output_test.rb +17 -10
  142. data/test/lib/vedeu/output/presentation_test.rb +35 -7
  143. data/test/lib/vedeu/output/renderers/escape_sequence_test.rb +50 -0
  144. data/test/lib/vedeu/output/renderers/file_test.rb +34 -30
  145. data/test/lib/vedeu/output/renderers/html_test.rb +61 -57
  146. data/test/lib/vedeu/output/renderers/json_test.rb +40 -36
  147. data/test/lib/vedeu/output/renderers/null_test.rb +12 -8
  148. data/test/lib/vedeu/output/renderers/terminal_test.rb +17 -13
  149. data/test/lib/vedeu/output/renderers/text_test.rb +17 -13
  150. data/test/lib/vedeu/repositories/model_test.rb +1 -1
  151. data/test/lib/vedeu/repositories/registerable_test.rb +28 -0
  152. data/test/lib/vedeu/storage/associative_store_test.rb +7 -0
  153. data/test/lib/vedeu/storage/conveyor_store_test.rb +7 -0
  154. data/test/lib/vedeu/storage/fifo_store_test.rb +7 -0
  155. data/test/support/helpers/model_test_class.rb +6 -2
  156. data/test/test_helper.rb +2 -0
  157. data/vedeu.gemspec +3 -2
  158. metadata +23 -6
  159. data/test/lib/vedeu/output/renderers/escape_sequence_renderer_test.rb +0 -46
@@ -2,51 +2,55 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
- describe Renderers::JSON do
5
+ module Renderers
6
6
 
7
- let(:described) { Vedeu::Renderers::JSON }
8
- let(:instance) { described.new(output) }
9
- let(:output) {}
7
+ describe JSON do
10
8
 
11
- describe '#initialize' do
12
- it { instance.must_be_instance_of(described) }
13
- it { instance.instance_variable_get('@output').must_equal(output) }
14
- end
9
+ let(:described) { Vedeu::Renderers::JSON }
10
+ let(:instance) { described.new(output) }
11
+ let(:output) {}
15
12
 
16
- describe '.render' do
17
- subject { described.render(output) }
13
+ describe '#initialize' do
14
+ it { instance.must_be_instance_of(described) }
15
+ it { instance.instance_variable_get('@output').must_equal(output) }
16
+ end
18
17
 
19
- it { subject.must_be_instance_of(String) }
18
+ describe '.render' do
19
+ subject { described.render(output) }
20
20
 
21
- context 'when the output is empty' do
22
- it { subject.must_equal('') }
23
- end
21
+ it { subject.must_be_instance_of(String) }
24
22
 
25
- context 'when the output is not empty' do
26
- let(:colour) {
27
- Vedeu::Colour.new(foreground: '#ff0000', background: '#ffffff')
28
- }
29
- let(:output) {
30
- [
23
+ context 'when the output is empty' do
24
+ it { subject.must_equal('') }
25
+ end
26
+
27
+ context 'when the output is not empty' do
28
+ let(:colour) {
29
+ Vedeu::Colour.new(foreground: '#ff0000', background: '#ffffff')
30
+ }
31
+ let(:output) {
31
32
  [
32
- Vedeu::Char.new(value: 'a',
33
- colour: colour,
34
- position: Vedeu::Position[5, 3])
33
+ [
34
+ Vedeu::Char.new(value: 'a',
35
+ colour: colour,
36
+ position: Vedeu::Position[5, 3])
37
+ ]
35
38
  ]
36
- ]
37
- }
38
- it { subject.must_equal(
39
- "{\"border\":\"\",\"colour\":{\"" \
40
- "background\":\"\\u001b[48;2;255;255;255m\"," \
41
- "\"foreground\":\"\\u001b[38;2;255;0;0m\"}," \
42
- "\"parent\":{\"" \
43
- "background\":\"\",\"foreground\":\"\",\"style\":\"\"}," \
44
- "\"position\":{\"y\":5,\"x\":3},\"style\":\"\"," \
45
- "\"value\":\"a\"}\n\n"
46
- ) }
39
+ }
40
+ it { subject.must_equal(
41
+ "{\"border\":\"\",\"colour\":{\"" \
42
+ "background\":\"\\u001b[48;2;255;255;255m\"," \
43
+ "\"foreground\":\"\\u001b[38;2;255;0;0m\"}," \
44
+ "\"parent\":{\"" \
45
+ "background\":\"\",\"foreground\":\"\",\"style\":\"\"}," \
46
+ "\"position\":{\"y\":5,\"x\":3},\"style\":\"\"," \
47
+ "\"value\":\"a\"}\n\n"
48
+ ) }
49
+ end
47
50
  end
48
- end
49
51
 
50
- end # Renderers::JSON
52
+ end # JSON
53
+
54
+ end # Renderers
51
55
 
52
56
  end # Vedeu
@@ -2,18 +2,22 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
- describe Renderers::Null do
5
+ module Renderers
6
6
 
7
- let(:described) { Vedeu::Renderers::Null }
7
+ describe Null do
8
8
 
9
- describe '.render' do
10
- let(:args) {}
9
+ let(:described) { Vedeu::Renderers::Null }
11
10
 
12
- subject { described.render(*args) }
11
+ describe '.render' do
12
+ let(:args) {}
13
13
 
14
- it { subject.must_be_instance_of(NilClass) }
15
- end
14
+ subject { described.render(*args) }
16
15
 
17
- end # Renderers::Null
16
+ it { subject.must_be_instance_of(NilClass) }
17
+ end
18
+
19
+ end # Null
20
+
21
+ end # Renderers
18
22
 
19
23
  end # Vedeu
@@ -2,23 +2,27 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
- describe Renderers::Terminal do
5
+ module Renderers
6
6
 
7
- let(:described) { Vedeu::Renderers::Terminal }
8
- let(:instance) { described.new(output) }
9
- let(:output) {}
7
+ describe Terminal do
10
8
 
11
- describe '#initialize' do
12
- it { instance.must_be_instance_of(described) }
13
- it { instance.instance_variable_get('@output').must_equal([output]) }
14
- end
9
+ let(:described) { Vedeu::Renderers::Terminal }
10
+ let(:instance) { described.new(output) }
11
+ let(:output) {}
15
12
 
16
- describe '.render' do
17
- subject { described.render }
13
+ describe '#initialize' do
14
+ it { instance.must_be_instance_of(described) }
15
+ it { instance.instance_variable_get('@output').must_equal([output]) }
16
+ end
18
17
 
19
- it { subject.must_be_instance_of(Array) }
20
- end
18
+ describe '.render' do
19
+ subject { described.render }
21
20
 
22
- end # Renderers::Terminal
21
+ it { subject.must_be_instance_of(Array) }
22
+ end
23
+
24
+ end # Terminal
25
+
26
+ end # Renderers
23
27
 
24
28
  end # Vedeu
@@ -2,23 +2,27 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
- describe Renderers::Text do
5
+ module Renderers
6
6
 
7
- let(:described) { Vedeu::Renderers::Text }
8
- let(:instance) { described.new(output) }
9
- let(:output) {}
7
+ describe Text do
10
8
 
11
- describe '#initialize' do
12
- it { instance.must_be_instance_of(described) }
13
- it { instance.instance_variable_get('@output').must_equal([output]) }
14
- end
9
+ let(:described) { Vedeu::Renderers::Text }
10
+ let(:instance) { described.new(output) }
11
+ let(:output) {}
15
12
 
16
- describe '.render' do
17
- subject { described.render }
13
+ describe '#initialize' do
14
+ it { instance.must_be_instance_of(described) }
15
+ it { instance.instance_variable_get('@output').must_equal([output]) }
16
+ end
18
17
 
19
- it { subject.must_be_instance_of(String) }
20
- end
18
+ describe '.render' do
19
+ subject { described.render }
21
20
 
22
- end # Renderers::Text
21
+ it { subject.must_be_instance_of(String) }
22
+ end
23
+
24
+ end # Text
25
+
26
+ end # Renderers
23
27
 
24
28
  end # Vedeu
@@ -13,7 +13,7 @@ module Vedeu
13
13
  @client = client
14
14
  end
15
15
 
16
- private
16
+ protected
17
17
 
18
18
  attr_reader :model
19
19
 
@@ -0,0 +1,28 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ describe Registerable do
6
+
7
+ class RegisterableTestClass
8
+
9
+ include Vedeu::Registerable
10
+
11
+ null Vedeu::ModelTestClass
12
+
13
+ end
14
+
15
+ describe '.included' do
16
+ it { RegisterableTestClass.must_respond_to(:null) }
17
+ end
18
+
19
+ describe '.null' do
20
+ subject { RegisterableTestClass.new }
21
+
22
+ it { subject.must_respond_to(:null_model) }
23
+ it { subject.null_model.must_equal(Vedeu::ModelTestClass) }
24
+ end
25
+
26
+ end # Registerable
27
+
28
+ end # Vedeu
@@ -39,6 +39,13 @@ module Vedeu
39
39
  end
40
40
  end
41
41
 
42
+ describe '#reset' do
43
+ subject { instance.reset }
44
+
45
+ it { subject.must_be_instance_of(Hash) }
46
+ it { subject.must_equal({}) }
47
+ end
48
+
42
49
  describe '#save' do
43
50
  let(:data) { [:some_data] }
44
51
  let(:_name) {}
@@ -105,6 +105,13 @@ module Vedeu
105
105
  end
106
106
  end
107
107
 
108
+ describe '#reset' do
109
+ subject { instance.reset }
110
+
111
+ it { subject.must_be_instance_of(Array) }
112
+ it { subject.must_equal([]) }
113
+ end
114
+
108
115
  describe '#save' do
109
116
  let(:data) { :beryllium }
110
117
  let(:front) { false }
@@ -33,6 +33,13 @@ module Vedeu
33
33
  end
34
34
  end
35
35
 
36
+ describe '#reset' do
37
+ subject { instance.reset }
38
+
39
+ it { subject.must_be_instance_of(Array) }
40
+ it { subject.must_equal([]) }
41
+ end
42
+
36
43
  describe '#save' do
37
44
  let(:data) { :beryllium }
38
45
  let(:storage) { [:lithium, :helium, :hydrogen] }
@@ -7,6 +7,10 @@ module Vedeu
7
7
 
8
8
  extend self
9
9
 
10
+ def by_name(name)
11
+ model
12
+ end
13
+
10
14
  # The real repository stores the model and returns it.
11
15
  def store(model)
12
16
  model
@@ -32,8 +36,8 @@ module Vedeu
32
36
  @attributes = defaults.merge!(attributes)
33
37
 
34
38
  @colour = @attributes[:colour]
35
- @name = @attributes[:name]
36
- @style = @attributes[:style]
39
+ @name = @attributes[:name]
40
+ @style = @attributes[:style]
37
41
  @repository = Vedeu::RepositoryTestModule
38
42
  end
39
43
 
data/test/test_helper.rb CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'simplecov'
2
+ require 'simplecov-console'
2
3
  require 'pry'
3
4
  require 'minitest/autorun'
4
5
  require 'minitest/pride' unless ENV['NO_COLOR']
@@ -7,6 +8,7 @@ require 'minitest/hell'
7
8
  # GC.disable # uncomment to remove ~20ms from test run speed
8
9
 
9
10
  SimpleCov.start do
11
+ formatter SimpleCov::Formatter::Console
10
12
  command_name 'MiniTest::Spec'
11
13
  add_filter '/test/'
12
14
  add_group 'buffers', 'vedeu/buffers'
data/vedeu.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'vedeu'
7
- spec.version = '0.4.18'
7
+ spec.version = '0.4.19'
8
8
  spec.authors = ['Gavin Laking']
9
9
  spec.email = ['gavinlaking@gmail.com']
10
10
  spec.summary = 'A terminal case of wonderland.'
@@ -34,6 +34,7 @@ Gem::Specification.new do |spec|
34
34
  spec.add_development_dependency 'rake', '10.4.2'
35
35
  spec.add_development_dependency 'rubocop', '0.30.0'
36
36
  spec.add_development_dependency 'ruby-prof', '0.15.6'
37
- spec.add_development_dependency 'simplecov', '0.9.2'
37
+ spec.add_development_dependency 'simplecov', '0.10.0'
38
+ spec.add_development_dependency 'simplecov-console', '0.2.0'
38
39
  spec.add_development_dependency 'yard', '0.8.7.6'
39
40
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vedeu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.18
4
+ version: 0.4.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Laking
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-18 00:00:00.000000000 Z
11
+ date: 2015-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aruba
@@ -240,14 +240,28 @@ dependencies:
240
240
  requirements:
241
241
  - - '='
242
242
  - !ruby/object:Gem::Version
243
- version: 0.9.2
243
+ version: 0.10.0
244
244
  type: :development
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
248
  - - '='
249
249
  - !ruby/object:Gem::Version
250
- version: 0.9.2
250
+ version: 0.10.0
251
+ - !ruby/object:Gem::Dependency
252
+ name: simplecov-console
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - '='
256
+ - !ruby/object:Gem::Version
257
+ version: 0.2.0
258
+ type: :development
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - '='
263
+ - !ruby/object:Gem::Version
264
+ version: 0.2.0
251
265
  - !ruby/object:Gem::Dependency
252
266
  name: yard
253
267
  requirement: !ruby/object:Gem::Requirement
@@ -439,6 +453,7 @@ files:
439
453
  - lib/vedeu/repositories/collections/lines.rb
440
454
  - lib/vedeu/repositories/collections/streams.rb
441
455
  - lib/vedeu/repositories/model.rb
456
+ - lib/vedeu/repositories/registerable.rb
442
457
  - lib/vedeu/repositories/repositories/all.rb
443
458
  - lib/vedeu/repositories/repositories/background_colours.rb
444
459
  - lib/vedeu/repositories/repositories/borders.rb
@@ -540,7 +555,7 @@ files:
540
555
  - test/lib/vedeu/output/presentation_test.rb
541
556
  - test/lib/vedeu/output/refresh_test.rb
542
557
  - test/lib/vedeu/output/renderers/all_test.rb
543
- - test/lib/vedeu/output/renderers/escape_sequence_renderer_test.rb
558
+ - test/lib/vedeu/output/renderers/escape_sequence_test.rb
544
559
  - test/lib/vedeu/output/renderers/file_test.rb
545
560
  - test/lib/vedeu/output/renderers/html_test.rb
546
561
  - test/lib/vedeu/output/renderers/json_test.rb
@@ -562,6 +577,7 @@ files:
562
577
  - test/lib/vedeu/repositories/collections/lines_test.rb
563
578
  - test/lib/vedeu/repositories/collections/streams_test.rb
564
579
  - test/lib/vedeu/repositories/model_test.rb
580
+ - test/lib/vedeu/repositories/registerable_test.rb
565
581
  - test/lib/vedeu/repositories/repositories/background_colours_test.rb
566
582
  - test/lib/vedeu/repositories/repositories/borders_test.rb
567
583
  - test/lib/vedeu/repositories/repositories/buffers_test.rb
@@ -693,7 +709,7 @@ test_files:
693
709
  - test/lib/vedeu/output/presentation_test.rb
694
710
  - test/lib/vedeu/output/refresh_test.rb
695
711
  - test/lib/vedeu/output/renderers/all_test.rb
696
- - test/lib/vedeu/output/renderers/escape_sequence_renderer_test.rb
712
+ - test/lib/vedeu/output/renderers/escape_sequence_test.rb
697
713
  - test/lib/vedeu/output/renderers/file_test.rb
698
714
  - test/lib/vedeu/output/renderers/html_test.rb
699
715
  - test/lib/vedeu/output/renderers/json_test.rb
@@ -715,6 +731,7 @@ test_files:
715
731
  - test/lib/vedeu/repositories/collections/lines_test.rb
716
732
  - test/lib/vedeu/repositories/collections/streams_test.rb
717
733
  - test/lib/vedeu/repositories/model_test.rb
734
+ - test/lib/vedeu/repositories/registerable_test.rb
718
735
  - test/lib/vedeu/repositories/repositories/background_colours_test.rb
719
736
  - test/lib/vedeu/repositories/repositories/borders_test.rb
720
737
  - test/lib/vedeu/repositories/repositories/buffers_test.rb
@@ -1,46 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu::Renderers
4
-
5
- describe EscapeSequence do
6
-
7
- let(:described) { Vedeu::Renderers::EscapeSequence }
8
- let(:instance) { described.new(output) }
9
- let(:output) {}
10
-
11
- describe '#initialize' do
12
- it { instance.must_be_instance_of(described) }
13
- it { instance.instance_variable_get('@output').must_equal(output) }
14
- end
15
-
16
- describe '.render' do
17
- subject { described.render(output) }
18
-
19
- it { subject.must_be_instance_of(String) }
20
-
21
- context 'when there is no output' do
22
- it { subject.must_equal('') }
23
- end
24
-
25
- context 'when there is output' do
26
- let(:output) {
27
- [
28
- Vedeu::Char.new(value: 't', colour: { background: '#ff0000', foreground: '#ffffff' }),
29
- Vedeu::Char.new(value: 'e', colour: { background: '#ffff00', foreground: '#000000' }),
30
- Vedeu::Char.new(value: 's', colour: { background: '#00ff00', foreground: '#000000' }),
31
- Vedeu::Char.new(value: 't', colour: { background: '#00ffff', foreground: '#000000' }),
32
- ]
33
- }
34
-
35
- it { subject.must_equal(
36
- "\\e[38;2;255;255;255m\\e[48;2;255;0;0mt\n" \
37
- "\\e[38;2;0;0;0m\\e[48;2;255;255;0me\n" \
38
- "\\e[38;2;0;0;0m\\e[48;2;0;255;0ms\n" \
39
- "\\e[38;2;0;0;0m\\e[48;2;0;255;255mt\n")
40
- }
41
- end
42
- end
43
-
44
- end # EscapeSequence
45
-
46
- end # Vedeu