vedeu 0.4.18 → 0.4.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +1 -1
- data/Rakefile +1 -0
- data/bin/vedeu_drb_server +0 -1
- data/bin/vedeu_test +0 -1
- data/config/rubocop_enabled.yml +1 -1
- data/examples/borders_app.rb +0 -1
- data/examples/colours_app.rb +0 -1
- data/examples/cursor_app.rb +0 -1
- data/examples/drb_app.rb +0 -1
- data/examples/geometry_app.rb +0 -1
- data/examples/hello_world.rb +0 -1
- data/examples/lines_app.rb +0 -1
- data/examples/material_colours_app.rb +0 -1
- data/examples/typed_commands/typed_commands_app.rb +0 -1
- data/examples/view_templates_app/view_templates_app.rb +0 -1
- data/lib/vedeu/api.rb +2 -1
- data/lib/vedeu/application.rb +3 -2
- data/lib/vedeu/bindings.rb +3 -5
- data/lib/vedeu/buffers/buffer.rb +8 -11
- data/lib/vedeu/buffers/display_buffer.rb +0 -2
- data/lib/vedeu/configuration/api.rb +1 -4
- data/lib/vedeu/configuration/cli.rb +153 -74
- data/lib/vedeu/configuration/configuration.rb +1 -2
- data/lib/vedeu/cursor/cursor.rb +0 -4
- data/lib/vedeu/cursor/move.rb +3 -6
- data/lib/vedeu/cursor/refresh_cursor.rb +12 -2
- data/lib/vedeu/distributed/client.rb +3 -2
- data/lib/vedeu/distributed/server.rb +4 -3
- data/lib/vedeu/distributed/subprocess.rb +3 -4
- data/lib/vedeu/distributed/test_application.rb +0 -1
- data/lib/vedeu/distributed/uri.rb +0 -1
- data/lib/vedeu/dsl/components/border.rb +3 -4
- data/lib/vedeu/dsl/components/geometry.rb +1 -5
- data/lib/vedeu/dsl/components/keymap.rb +1 -3
- data/lib/vedeu/dsl/components/menu.rb +1 -2
- data/lib/vedeu/dsl/composition.rb +3 -4
- data/lib/vedeu/dsl/group.rb +1 -4
- data/lib/vedeu/dsl/interface.rb +3 -10
- data/lib/vedeu/dsl/line.rb +3 -4
- data/lib/vedeu/dsl/shared/text.rb +0 -3
- data/lib/vedeu/dsl/stream.rb +3 -4
- data/lib/vedeu/dsl/view.rb +0 -3
- data/lib/vedeu/events/event.rb +3 -3
- data/lib/vedeu/events/trigger.rb +3 -2
- data/lib/vedeu/geometry/area.rb +0 -1
- data/lib/vedeu/geometry/canvas.rb +0 -1
- data/lib/vedeu/geometry/coordinate.rb +6 -7
- data/lib/vedeu/geometry/dimension.rb +3 -2
- data/lib/vedeu/geometry/geometry.rb +0 -6
- data/lib/vedeu/geometry/grid.rb +3 -2
- data/lib/vedeu/geometry/index_position.rb +0 -1
- data/lib/vedeu/geometry/position.rb +0 -1
- data/lib/vedeu/geometry/position_index.rb +0 -1
- data/lib/vedeu/geometry/position_validator.rb +6 -68
- data/lib/vedeu/input/all.rb +0 -2
- data/lib/vedeu/input/input.rb +3 -2
- data/lib/vedeu/input/key.rb +0 -1
- data/lib/vedeu/input/keymap.rb +4 -7
- data/lib/vedeu/input/mapper.rb +3 -2
- data/lib/vedeu/launcher.rb +3 -2
- data/lib/vedeu/main_loop.rb +1 -1
- data/lib/vedeu/models/cell.rb +0 -1
- data/lib/vedeu/models/char.rb +0 -1
- data/lib/vedeu/models/composition.rb +1 -7
- data/lib/vedeu/models/group.rb +0 -3
- data/lib/vedeu/models/interface.rb +0 -3
- data/lib/vedeu/models/line.rb +0 -4
- data/lib/vedeu/models/menu.rb +5 -8
- data/lib/vedeu/models/stream.rb +0 -4
- data/lib/vedeu/null/all.rb +11 -0
- data/lib/vedeu/null/border.rb +3 -1
- data/lib/vedeu/null/buffer.rb +0 -1
- data/lib/vedeu/null/generic.rb +4 -1
- data/lib/vedeu/null/geometry.rb +0 -1
- data/lib/vedeu/null/interface.rb +36 -7
- data/lib/vedeu/output/background.rb +0 -1
- data/lib/vedeu/output/border.rb +1 -6
- data/lib/vedeu/output/clear.rb +3 -2
- data/lib/vedeu/output/colour.rb +6 -18
- data/lib/vedeu/output/compressor.rb +5 -2
- data/lib/vedeu/output/esc.rb +4 -1
- data/lib/vedeu/output/foreground.rb +0 -5
- data/lib/vedeu/output/html_char.rb +3 -2
- data/lib/vedeu/output/output.rb +1 -5
- data/lib/vedeu/output/refresh.rb +1 -1
- data/lib/vedeu/output/renderers/all.rb +0 -1
- data/lib/vedeu/output/renderers/escape_sequence.rb +3 -2
- data/lib/vedeu/output/renderers/file.rb +85 -80
- data/lib/vedeu/output/renderers/html.rb +77 -72
- data/lib/vedeu/output/renderers/json.rb +45 -42
- data/lib/vedeu/output/renderers/null.rb +11 -8
- data/lib/vedeu/output/renderers/terminal.rb +41 -36
- data/lib/vedeu/output/renderers/text.rb +41 -36
- data/lib/vedeu/output/style.rb +0 -3
- data/lib/vedeu/output/text.rb +3 -2
- data/lib/vedeu/output/viewport.rb +3 -2
- data/lib/vedeu/output/virtual_terminal.rb +0 -1
- data/lib/vedeu/output/wordwrap.rb +3 -2
- data/lib/vedeu/repositories/all.rb +7 -6
- data/lib/vedeu/repositories/collection.rb +0 -1
- data/lib/vedeu/repositories/collections/chars.rb +0 -1
- data/lib/vedeu/repositories/collections/events.rb +0 -1
- data/lib/vedeu/repositories/collections/interfaces.rb +0 -1
- data/lib/vedeu/repositories/collections/keys.rb +0 -1
- data/lib/vedeu/repositories/collections/lines.rb +0 -1
- data/lib/vedeu/repositories/collections/streams.rb +0 -1
- data/lib/vedeu/repositories/model.rb +0 -1
- data/lib/vedeu/repositories/registerable.rb +29 -0
- data/lib/vedeu/repositories/repositories/background_colours.rb +0 -1
- data/lib/vedeu/repositories/repositories/borders.rb +2 -13
- data/lib/vedeu/repositories/repositories/buffers.rb +2 -13
- data/lib/vedeu/repositories/repositories/colours.rb +0 -1
- data/lib/vedeu/repositories/repositories/cursors.rb +1 -2
- data/lib/vedeu/repositories/repositories/events_repository.rb +0 -1
- data/lib/vedeu/repositories/repositories/foreground_colours.rb +0 -1
- data/lib/vedeu/repositories/repositories/geometries.rb +2 -13
- data/lib/vedeu/repositories/repositories/groups.rb +1 -2
- data/lib/vedeu/repositories/repositories/interfaces_repository.rb +2 -14
- data/lib/vedeu/repositories/repositories/keymaps.rb +1 -2
- data/lib/vedeu/repositories/repositories/menus.rb +1 -2
- data/lib/vedeu/repositories/repository.rb +14 -5
- data/lib/vedeu/storage/all.rb +0 -1
- data/lib/vedeu/storage/associative_store.rb +0 -1
- data/lib/vedeu/storage/conveyor_store.rb +0 -1
- data/lib/vedeu/storage/fifo_store.rb +0 -1
- data/lib/vedeu/support/log.rb +0 -3
- data/lib/vedeu/support/options.rb +3 -2
- data/lib/vedeu/support/template.rb +3 -4
- data/lib/vedeu/support/terminal.rb +0 -2
- data/lib/vedeu/support/trace.rb +6 -7
- data/lib/vedeu/support/visibility.rb +1 -2
- data/lib/vedeu.rb +3 -5
- data/test/lib/vedeu/buffers/buffer_test.rb +48 -13
- data/test/lib/vedeu/configuration/cli_test.rb +5 -4
- data/test/lib/vedeu/cursor/refresh_cursor_test.rb +37 -15
- data/test/lib/vedeu/distributed/subprocess_test.rb +1 -0
- data/test/lib/vedeu/dsl/shared/use_test.rb +1 -6
- data/test/lib/vedeu/main_loop_test.rb +11 -0
- data/test/lib/vedeu/null/interface_test.rb +27 -0
- data/test/lib/vedeu/output/output_test.rb +17 -10
- data/test/lib/vedeu/output/presentation_test.rb +35 -7
- data/test/lib/vedeu/output/renderers/escape_sequence_test.rb +50 -0
- data/test/lib/vedeu/output/renderers/file_test.rb +34 -30
- data/test/lib/vedeu/output/renderers/html_test.rb +61 -57
- data/test/lib/vedeu/output/renderers/json_test.rb +40 -36
- data/test/lib/vedeu/output/renderers/null_test.rb +12 -8
- data/test/lib/vedeu/output/renderers/terminal_test.rb +17 -13
- data/test/lib/vedeu/output/renderers/text_test.rb +17 -13
- data/test/lib/vedeu/repositories/model_test.rb +1 -1
- data/test/lib/vedeu/repositories/registerable_test.rb +28 -0
- data/test/lib/vedeu/storage/associative_store_test.rb +7 -0
- data/test/lib/vedeu/storage/conveyor_store_test.rb +7 -0
- data/test/lib/vedeu/storage/fifo_store_test.rb +7 -0
- data/test/support/helpers/model_test_class.rb +6 -2
- data/test/test_helper.rb +2 -0
- data/vedeu.gemspec +3 -2
- metadata +23 -6
- 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
|
-
|
5
|
+
module Renderers
|
6
6
|
|
7
|
-
|
8
|
-
let(:instance) { described.new(output) }
|
9
|
-
let(:output) {}
|
7
|
+
describe JSON do
|
10
8
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
end
|
9
|
+
let(:described) { Vedeu::Renderers::JSON }
|
10
|
+
let(:instance) { described.new(output) }
|
11
|
+
let(:output) {}
|
15
12
|
|
16
|
-
|
17
|
-
|
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
|
-
|
18
|
+
describe '.render' do
|
19
|
+
subject { described.render(output) }
|
20
20
|
|
21
|
-
|
22
|
-
it { subject.must_equal('') }
|
23
|
-
end
|
21
|
+
it { subject.must_be_instance_of(String) }
|
24
22
|
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
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
|
-
|
33
|
-
|
34
|
-
|
33
|
+
[
|
34
|
+
Vedeu::Char.new(value: 'a',
|
35
|
+
colour: colour,
|
36
|
+
position: Vedeu::Position[5, 3])
|
37
|
+
]
|
35
38
|
]
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
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
|
-
|
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
|
-
|
5
|
+
module Renderers
|
6
6
|
|
7
|
-
|
7
|
+
describe Null do
|
8
8
|
|
9
|
-
|
10
|
-
let(:args) {}
|
9
|
+
let(:described) { Vedeu::Renderers::Null }
|
11
10
|
|
12
|
-
|
11
|
+
describe '.render' do
|
12
|
+
let(:args) {}
|
13
13
|
|
14
|
-
|
15
|
-
end
|
14
|
+
subject { described.render(*args) }
|
16
15
|
|
17
|
-
|
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
|
-
|
5
|
+
module Renderers
|
6
6
|
|
7
|
-
|
8
|
-
let(:instance) { described.new(output) }
|
9
|
-
let(:output) {}
|
7
|
+
describe Terminal do
|
10
8
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
end
|
9
|
+
let(:described) { Vedeu::Renderers::Terminal }
|
10
|
+
let(:instance) { described.new(output) }
|
11
|
+
let(:output) {}
|
15
12
|
|
16
|
-
|
17
|
-
|
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
|
-
|
20
|
-
|
18
|
+
describe '.render' do
|
19
|
+
subject { described.render }
|
21
20
|
|
22
|
-
|
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
|
-
|
5
|
+
module Renderers
|
6
6
|
|
7
|
-
|
8
|
-
let(:instance) { described.new(output) }
|
9
|
-
let(:output) {}
|
7
|
+
describe Text do
|
10
8
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
end
|
9
|
+
let(:described) { Vedeu::Renderers::Text }
|
10
|
+
let(:instance) { described.new(output) }
|
11
|
+
let(:output) {}
|
15
12
|
|
16
|
-
|
17
|
-
|
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
|
-
|
20
|
-
|
18
|
+
describe '.render' do
|
19
|
+
subject { described.render }
|
21
20
|
|
22
|
-
|
21
|
+
it { subject.must_be_instance_of(String) }
|
22
|
+
end
|
23
|
+
|
24
|
+
end # Text
|
25
|
+
|
26
|
+
end # Renderers
|
23
27
|
|
24
28
|
end # Vedeu
|
@@ -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
|
@@ -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
|
36
|
-
@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.
|
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.
|
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.
|
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-
|
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.
|
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.
|
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/
|
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/
|
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
|