vedeu 0.1.18 → 0.1.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +5 -0
- data/Dockerfile +40 -0
- data/README.md +7 -30
- data/docs/api.md +79 -0
- data/docs/events.md +121 -0
- data/lib/vedeu.rb +61 -18
- data/lib/vedeu/api/api.rb +73 -53
- data/lib/vedeu/api/composition.rb +4 -1
- data/lib/vedeu/api/defined.rb +35 -0
- data/lib/vedeu/api/helpers.rb +20 -15
- data/lib/vedeu/api/interface.rb +17 -12
- data/lib/vedeu/api/line.rb +20 -12
- data/lib/vedeu/api/stream.rb +3 -0
- data/lib/vedeu/application.rb +34 -1
- data/lib/vedeu/configuration.rb +15 -3
- data/lib/vedeu/input/input.rb +77 -0
- data/lib/vedeu/launcher.rb +7 -0
- data/lib/vedeu/models/attributes/background.rb +15 -2
- data/lib/vedeu/models/attributes/coercions.rb +18 -3
- data/lib/vedeu/models/attributes/colour_translator.rb +23 -17
- data/lib/vedeu/models/attributes/foreground.rb +10 -2
- data/lib/vedeu/models/attributes/presentation.rb +62 -0
- data/lib/vedeu/models/colour.rb +7 -3
- data/lib/vedeu/models/composition.rb +17 -19
- data/lib/vedeu/models/geometry.rb +13 -5
- data/lib/vedeu/models/interface.rb +35 -19
- data/lib/vedeu/models/line.rb +24 -8
- data/lib/vedeu/models/stream.rb +13 -7
- data/lib/vedeu/models/style.rb +17 -7
- data/lib/vedeu/{support → output}/clear.rb +14 -0
- data/lib/vedeu/output/compositor.rb +77 -0
- data/lib/vedeu/output/refresh.rb +129 -0
- data/lib/vedeu/{support → output}/render.rb +49 -13
- data/lib/vedeu/{support → output}/view.rb +15 -8
- data/lib/vedeu/repositories/buffers.rb +181 -0
- data/lib/vedeu/{support → repositories}/events.rb +16 -6
- data/lib/vedeu/repositories/focus.rb +109 -0
- data/lib/vedeu/repositories/groups.rb +76 -0
- data/lib/vedeu/repositories/interfaces.rb +74 -0
- data/lib/vedeu/support/common.rb +20 -0
- data/lib/vedeu/support/cursor.rb +77 -0
- data/lib/vedeu/support/esc.rb +181 -46
- data/lib/vedeu/support/event.rb +22 -4
- data/lib/vedeu/support/grid.rb +10 -3
- data/lib/vedeu/support/log.rb +14 -1
- data/lib/vedeu/support/menu.rb +51 -12
- data/lib/vedeu/support/position.rb +9 -0
- data/lib/vedeu/support/terminal.rb +49 -15
- data/lib/vedeu/support/trace.rb +11 -4
- data/test/integration/defining_interfaces_test.rb +27 -0
- data/test/integration/views/basic_view_test.rb +767 -0
- data/test/lib/vedeu/api/api_test.rb +32 -37
- data/test/lib/vedeu/api/composition_test.rb +23 -61
- data/test/lib/vedeu/api/defined_test.rb +49 -0
- data/test/lib/vedeu/api/helpers_test.rb +91 -0
- data/test/lib/vedeu/api/interface_test.rb +136 -688
- data/test/lib/vedeu/api/line_test.rb +28 -32
- data/test/lib/vedeu/application_test.rb +6 -0
- data/test/lib/vedeu/configuration_test.rb +8 -4
- data/test/lib/vedeu/{support → input}/input_test.rb +9 -0
- data/test/lib/vedeu/launcher_test.rb +6 -0
- data/test/lib/vedeu/models/attributes/{coercer_test.rb → coercions_test.rb} +11 -10
- data/test/lib/vedeu/models/attributes/colour_translator_test.rb +13 -0
- data/test/lib/vedeu/models/attributes/presentation_test.rb +30 -0
- data/test/lib/vedeu/models/colour_test.rb +8 -0
- data/test/lib/vedeu/models/composition_test.rb +208 -200
- data/test/lib/vedeu/models/geometry_test.rb +39 -0
- data/test/lib/vedeu/models/interface_test.rb +11 -1
- data/test/lib/vedeu/models/line_test.rb +8 -1
- data/test/lib/vedeu/models/stream_test.rb +35 -0
- data/test/lib/vedeu/models/style_test.rb +8 -0
- data/test/lib/vedeu/{support → output}/clear_test.rb +1 -1
- data/test/lib/vedeu/output/compositor_test.rb +64 -0
- data/test/lib/vedeu/output/refresh_test.rb +48 -0
- data/test/lib/vedeu/{support → output}/render_test.rb +36 -0
- data/test/lib/vedeu/{support → output}/view_test.rb +0 -0
- data/test/lib/vedeu/repositories/buffers_test.rb +48 -0
- data/test/lib/vedeu/{support → repositories}/events_test.rb +0 -0
- data/test/lib/vedeu/repositories/focus_test.rb +74 -0
- data/test/lib/vedeu/repositories/groups_test.rb +66 -0
- data/test/lib/vedeu/repositories/interfaces_test.rb +6 -0
- data/test/lib/vedeu/support/common_test.rb +6 -0
- data/test/lib/vedeu/support/cursor_test.rb +79 -0
- data/test/lib/vedeu/support/log_test.rb +6 -0
- data/test/lib/vedeu/support/terminal_test.rb +6 -28
- data/test/lib/vedeu/support/trace_test.rb +6 -0
- data/test/test_helper.rb +37 -0
- data/vedeu.gemspec +1 -1
- metadata +65 -33
- data/bin/log +0 -13
- data/lib/vedeu/support/buffer.rb +0 -69
- data/lib/vedeu/support/buffers.rb +0 -106
- data/lib/vedeu/support/focus.rb +0 -83
- data/lib/vedeu/support/groups.rb +0 -61
- data/lib/vedeu/support/input.rb +0 -67
- data/test/lib/vedeu/support/buffer_test.rb +0 -83
- data/test/lib/vedeu/support/buffers_test.rb +0 -15
- data/test/lib/vedeu/support/focus_test.rb +0 -114
- data/test/lib/vedeu/support/groups_test.rb +0 -65
@@ -5,16 +5,20 @@ module Vedeu
|
|
5
5
|
describe Line do
|
6
6
|
describe '#stream' do
|
7
7
|
it 'returns the value assigned' do
|
8
|
-
Line.new
|
8
|
+
line = Line.new
|
9
|
+
attrs = line.stream do
|
9
10
|
text 'Some text...'
|
10
|
-
end
|
11
|
+
end
|
12
|
+
|
13
|
+
attrs.must_equal(
|
11
14
|
[
|
12
15
|
{
|
13
16
|
colour: {},
|
14
|
-
style:
|
15
|
-
text:
|
16
|
-
width:
|
17
|
-
align:
|
17
|
+
style: [],
|
18
|
+
text: "Some text...",
|
19
|
+
width: nil,
|
20
|
+
align: :left,
|
21
|
+
parent: line.view_attributes,
|
18
22
|
}
|
19
23
|
]
|
20
24
|
)
|
@@ -43,37 +47,29 @@ module Vedeu
|
|
43
47
|
|
44
48
|
describe '#foreground' do
|
45
49
|
it 'returns the value assigned' do
|
46
|
-
Line.new.foreground('#ff0000')
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
align: :left
|
56
|
-
}
|
57
|
-
]
|
58
|
-
)
|
50
|
+
attrs = Line.new.foreground('#ff0000')
|
51
|
+
attrs.first[:colour].must_equal({ foreground: "#ff0000" })
|
52
|
+
end
|
53
|
+
|
54
|
+
it 'returns the value assigned with a block' do
|
55
|
+
attrs = Line.new.foreground('#00ff00') do
|
56
|
+
# ...
|
57
|
+
end
|
58
|
+
attrs.first[:colour].must_equal({ foreground: "#00ff00" })
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
62
|
describe '#background' do
|
63
63
|
it 'returns the value assigned' do
|
64
|
-
Line.new.background('#00ff00')
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
align: :left
|
74
|
-
}
|
75
|
-
]
|
76
|
-
)
|
64
|
+
attrs = Line.new.background('#00ff00')
|
65
|
+
attrs.first[:colour].must_equal({ background: "#00ff00" })
|
66
|
+
end
|
67
|
+
|
68
|
+
it 'returns the value assigned with a block' do
|
69
|
+
attrs = Line.new.background('#0000ff') do
|
70
|
+
# ...
|
71
|
+
end
|
72
|
+
attrs.first[:colour].must_equal({ background: "#0000ff" })
|
77
73
|
end
|
78
74
|
end
|
79
75
|
end
|
@@ -3,8 +3,7 @@ require 'test_helper'
|
|
3
3
|
module Vedeu
|
4
4
|
describe Configuration do
|
5
5
|
before { Configuration.reset }
|
6
|
-
|
7
|
-
after { Configuration.reset }
|
6
|
+
after { Configuration.reset }
|
8
7
|
|
9
8
|
describe '#colour_mode' do
|
10
9
|
it 'returns the value of the colour_mode option' do
|
@@ -13,8 +12,8 @@ module Vedeu
|
|
13
12
|
end
|
14
13
|
|
15
14
|
it '--colour-mode' do
|
16
|
-
Configuration.configure(['--colour-mode', '
|
17
|
-
Configuration.colour_mode.must_equal(
|
15
|
+
Configuration.configure(['--colour-mode', '16777216'])
|
16
|
+
Configuration.colour_mode.must_equal(16777216)
|
18
17
|
end
|
19
18
|
|
20
19
|
it '--colour-mode' do
|
@@ -22,6 +21,11 @@ module Vedeu
|
|
22
21
|
Configuration.colour_mode.must_equal(256)
|
23
22
|
end
|
24
23
|
|
24
|
+
it '--colour-mode' do
|
25
|
+
Configuration.configure(['--colour-mode', '16'])
|
26
|
+
Configuration.colour_mode.must_equal(16)
|
27
|
+
end
|
28
|
+
|
25
29
|
it '--colour-mode' do
|
26
30
|
Configuration.configure(['--colour-mode', '348'])
|
27
31
|
Configuration.colour_mode.must_equal(8)
|
@@ -2,6 +2,13 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
module Vedeu
|
4
4
|
describe Input do
|
5
|
+
|
6
|
+
describe '#initialize' do
|
7
|
+
it 'returns an instance of itself' do
|
8
|
+
Input.new.must_be_instance_of(Input)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
5
12
|
describe '.capture' do
|
6
13
|
keypresses = {
|
7
14
|
"\r" => :enter,
|
@@ -47,6 +54,8 @@ module Vedeu
|
|
47
54
|
end
|
48
55
|
|
49
56
|
it 'switches the terminal mode when escape is pressed' do
|
57
|
+
skip # TODO: Fix this; it intermittently fails because the event isn't
|
58
|
+
# registered some of the time.
|
50
59
|
Terminal.stub :input, "\e" do
|
51
60
|
Vedeu.stub :log, nil do
|
52
61
|
proc { Input.capture }.must_raise(ModeSwitch)
|
@@ -4,20 +4,17 @@ module Vedeu
|
|
4
4
|
class TestClass
|
5
5
|
include Coercions
|
6
6
|
|
7
|
+
attr_reader :attributes
|
8
|
+
|
7
9
|
def initialize(attributes = {})
|
8
10
|
@attributes = attributes
|
9
11
|
@name = attributes[:name]
|
12
|
+
@parent = attributes[:parent]
|
10
13
|
end
|
11
14
|
end
|
12
15
|
|
13
16
|
describe Coercions do
|
14
17
|
describe '.coercer' do
|
15
|
-
let(:klass) { mock('TestClass') }
|
16
|
-
|
17
|
-
before do
|
18
|
-
TestClass.stubs(:new).returns(klass)
|
19
|
-
end
|
20
|
-
|
21
18
|
[nil, [], {}].each do |empty_value|
|
22
19
|
it 'returns an empty collection when nil or empty' do
|
23
20
|
TestClass.coercer(empty_value).must_equal([])
|
@@ -25,13 +22,15 @@ module Vedeu
|
|
25
22
|
end
|
26
23
|
|
27
24
|
it 'returns when an object' do
|
25
|
+
klass = TestClass.new
|
26
|
+
|
28
27
|
TestClass.coercer([klass]).must_equal([klass])
|
29
28
|
end
|
30
29
|
|
31
30
|
it 'returns a collection of models when a single hash' do
|
32
31
|
coerced = TestClass.coercer({ :name => 'test1' })
|
33
|
-
coerced.
|
34
|
-
coerced.must_equal(
|
32
|
+
coerced.must_be_instance_of(Array)
|
33
|
+
coerced.first.attributes.must_equal({ name: "test1", parent: nil })
|
35
34
|
end
|
36
35
|
|
37
36
|
it 'returns a collection of models when multiple hashes' do
|
@@ -39,13 +38,15 @@ module Vedeu
|
|
39
38
|
{ :name => 'test1' }, { :name => 'test2' }
|
40
39
|
])
|
41
40
|
coerced.size.must_equal(2)
|
42
|
-
coerced.must_equal(
|
41
|
+
coerced.map(&:attributes).must_equal(
|
42
|
+
[{ name: "test1", parent: nil }, { name: "test2", parent: nil }]
|
43
|
+
)
|
43
44
|
end
|
44
45
|
|
45
46
|
it 'returns a collection of models when a single array' do
|
46
47
|
coerced = TestClass.coercer([{ :name => 'test3' }])
|
47
48
|
coerced.size.must_equal(1)
|
48
|
-
coerced.must_equal(
|
49
|
+
coerced.first.attributes.must_equal({ name: "test3", parent: nil })
|
49
50
|
end
|
50
51
|
end
|
51
52
|
end
|
@@ -26,5 +26,35 @@ module Vedeu
|
|
26
26
|
receiver.style.must_be_instance_of(Style)
|
27
27
|
end
|
28
28
|
end
|
29
|
+
|
30
|
+
describe '#to_s' do
|
31
|
+
it 'returns output' do
|
32
|
+
line = Line.new({
|
33
|
+
colour: {
|
34
|
+
foreground: '#00ff00',
|
35
|
+
background: '#000000'
|
36
|
+
},
|
37
|
+
style: 'normal'
|
38
|
+
})
|
39
|
+
stream = Stream.new({
|
40
|
+
colour: {
|
41
|
+
foreground: '#ff0000',
|
42
|
+
background: '#000000'
|
43
|
+
},
|
44
|
+
text: 'Some text',
|
45
|
+
style: 'underline',
|
46
|
+
width: nil,
|
47
|
+
align: :left,
|
48
|
+
parent: line.view_attributes,
|
49
|
+
})
|
50
|
+
stream.to_s.must_equal(
|
51
|
+
"\e[38;2;255;0;0m\e[48;2;0;0;0m" \
|
52
|
+
"\e[4m" \
|
53
|
+
"Some text" \
|
54
|
+
"\e[24m\e[22m\e[27m" \
|
55
|
+
"\e[38;2;0;255;0m\e[48;2;0;0;0m"
|
56
|
+
)
|
57
|
+
end
|
58
|
+
end
|
29
59
|
end
|
30
60
|
end
|
@@ -2,6 +2,14 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
module Vedeu
|
4
4
|
describe Colour do
|
5
|
+
describe '#initialize' do
|
6
|
+
it 'returns an instance of itself' do
|
7
|
+
attributes = {}
|
8
|
+
|
9
|
+
Colour.new(attributes).must_be_instance_of(Colour)
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
5
13
|
describe '#background' do
|
6
14
|
it 'returns an escape sequence' do
|
7
15
|
Colour.new({
|
@@ -9,6 +9,14 @@ module Vedeu
|
|
9
9
|
|
10
10
|
before { Buffers.reset }
|
11
11
|
|
12
|
+
describe '#initialize' do
|
13
|
+
it 'returns an instance of itself' do
|
14
|
+
attributes = {}
|
15
|
+
|
16
|
+
Composition.new(attributes).must_be_instance_of(Composition)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
12
20
|
describe '#interfaces' do
|
13
21
|
it 'returns a collection of interfaces' do
|
14
22
|
Vedeu.interface('dummy') do
|
@@ -28,224 +36,224 @@ module Vedeu
|
|
28
36
|
end
|
29
37
|
end
|
30
38
|
|
31
|
-
describe '#to_s' do
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
+
# describe '#to_s' do
|
40
|
+
# it 'returns the stringified content for a single interface, single line, single stream' do
|
41
|
+
# Vedeu.interface('int1_lin1_str1') do
|
42
|
+
# y 3
|
43
|
+
# x 3
|
44
|
+
# width 15
|
45
|
+
# height 3
|
46
|
+
# end
|
39
47
|
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
48
|
+
# Composition.new(attributes[:test_0001]).to_s.must_equal(
|
49
|
+
# "\e[3;3H \e[3;3H" \
|
50
|
+
# "\e[4;3H \e[4;3H" \
|
51
|
+
# "\e[5;3H \e[5;3H" \
|
52
|
+
# "\e[3;3HSome text...\e[?25h"
|
53
|
+
# )
|
54
|
+
# end
|
47
55
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
56
|
+
# it 'returns the stringified content for a single interface, single line, multiple streams' do
|
57
|
+
# Vedeu.interface('int1_lin1_str3') do
|
58
|
+
# y 3
|
59
|
+
# x 3
|
60
|
+
# width 30
|
61
|
+
# height 3
|
62
|
+
# end
|
55
63
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
64
|
+
# Composition.new(attributes[:test_0002]).to_s.must_equal(
|
65
|
+
# "\e[3;3H \e[3;3H" \
|
66
|
+
# "\e[4;3H \e[4;3H" \
|
67
|
+
# "\e[5;3H \e[5;3H" \
|
68
|
+
# "\e[3;3HSome text... more text...\e[?25h"
|
69
|
+
# )
|
70
|
+
# end
|
63
71
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
72
|
+
# it 'returns the stringified content for a single interface, multiple lines, single stream' do
|
73
|
+
# Vedeu.interface('int1_lin2_str1') do
|
74
|
+
# y 3
|
75
|
+
# x 3
|
76
|
+
# width 15
|
77
|
+
# height 3
|
78
|
+
# end
|
71
79
|
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
+
# Composition.new(attributes[:test_0003]).to_s.must_equal(
|
81
|
+
# "\e[3;3H \e[3;3H" \
|
82
|
+
# "\e[4;3H \e[4;3H" \
|
83
|
+
# "\e[5;3H \e[5;3H" \
|
84
|
+
# "\e[3;3HSome text..." \
|
85
|
+
# "\e[4;3HSome text...\e[?25h"
|
86
|
+
# )
|
87
|
+
# end
|
80
88
|
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
89
|
+
# it 'returns the stringified content for a single interface, multiple lines, multiple streams' do
|
90
|
+
# Vedeu.interface('int1_lin2_str3') do
|
91
|
+
# y 3
|
92
|
+
# x 3
|
93
|
+
# width 30
|
94
|
+
# height 3
|
95
|
+
# end
|
88
96
|
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
+
# Composition.new(attributes[:test_0004]).to_s.must_equal(
|
98
|
+
# "\e[3;3H \e[3;3H" \
|
99
|
+
# "\e[4;3H \e[4;3H" \
|
100
|
+
# "\e[5;3H \e[5;3H" \
|
101
|
+
# "\e[3;3HSome text... more text..." \
|
102
|
+
# "\e[4;3HSome text... more text...\e[?25h"
|
103
|
+
# )
|
104
|
+
# end
|
97
105
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
106
|
+
# it 'returns the stringified content for a single interface, multiple lines, multiple streams, streams contain styles' do
|
107
|
+
# Vedeu.interface('int1_lin2_str3_styles') do
|
108
|
+
# y 3
|
109
|
+
# x 3
|
110
|
+
# width 30
|
111
|
+
# height 3
|
112
|
+
# end
|
105
113
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
114
|
+
# Composition.new(attributes[:test_0005]).to_s.must_equal(
|
115
|
+
# "\e[3;3H \e[3;3H" \
|
116
|
+
# "\e[4;3H \e[4;3H" \
|
117
|
+
# "\e[5;3H \e[5;3H" \
|
118
|
+
# "\e[3;3H\e[38;2;0;0;0m\e[48;2;0;0;255m\e[24m\e[22m\e[27m\e[4mSome text...\e[38;2;255;255;0m\e[48;2;0;255;0m\e[24m\e[22m\e[27m \e[38;2;255;255;255m\e[48;2;255;0;255m\e[1mmore text...\e[?25h"
|
119
|
+
# )
|
120
|
+
# end
|
113
121
|
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
122
|
+
# it 'returns the stringified content for multiple interfaces, single line, single stream' do
|
123
|
+
# Vedeu.interface('int2_lin1_str1_1') do
|
124
|
+
# y 3
|
125
|
+
# x 3
|
126
|
+
# width 15
|
127
|
+
# height 3
|
128
|
+
# end
|
129
|
+
# Vedeu.interface('int2_lin1_str1_2') do
|
130
|
+
# y 6
|
131
|
+
# x 6
|
132
|
+
# width 15
|
133
|
+
# height 3
|
134
|
+
# end
|
127
135
|
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
136
|
+
# Composition.new(attributes[:test_0006]).to_s.must_equal(
|
137
|
+
# "\e[3;3H \e[3;3H" \
|
138
|
+
# "\e[4;3H \e[4;3H" \
|
139
|
+
# "\e[5;3H \e[5;3H" \
|
140
|
+
# "\e[3;3HSome text...\e[?25h" \
|
141
|
+
# "\e[6;6H \e[6;6H" \
|
142
|
+
# "\e[7;6H \e[7;6H" \
|
143
|
+
# "\e[8;6H \e[8;6H" \
|
144
|
+
# "\e[6;6HSome text...\e[?25h"
|
145
|
+
# )
|
146
|
+
# end
|
139
147
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
148
|
+
# it 'returns the stringified content for multiple interfaces, single line, multiple streams' do
|
149
|
+
# Vedeu.interface('int2_lin1_str3_1') do
|
150
|
+
# y 3
|
151
|
+
# x 3
|
152
|
+
# width 30
|
153
|
+
# height 3
|
154
|
+
# end
|
155
|
+
# Vedeu.interface('int2_lin1_str3_2') do
|
156
|
+
# y 6
|
157
|
+
# x 6
|
158
|
+
# width 30
|
159
|
+
# height 3
|
160
|
+
# end
|
153
161
|
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
162
|
+
# Composition.new(attributes[:test_0007]).to_s.must_equal(
|
163
|
+
# "\e[3;3H \e[3;3H" \
|
164
|
+
# "\e[4;3H \e[4;3H" \
|
165
|
+
# "\e[5;3H \e[5;3H" \
|
166
|
+
# "\e[3;3HSome text... more text...\e[?25h" \
|
167
|
+
# "\e[6;6H \e[6;6H" \
|
168
|
+
# "\e[7;6H \e[7;6H" \
|
169
|
+
# "\e[8;6H \e[8;6H" \
|
170
|
+
# "\e[6;6HSome text... more text...\e[?25h"
|
171
|
+
# )
|
172
|
+
# end
|
165
173
|
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
174
|
+
# it 'returns the stringified content for multiple interfaces, multiple lines, single stream' do
|
175
|
+
# Vedeu.interface('int2_lin2_str1_1') do
|
176
|
+
# y 3
|
177
|
+
# x 3
|
178
|
+
# width 15
|
179
|
+
# height 3
|
180
|
+
# end
|
181
|
+
# Vedeu.interface('int2_lin2_str1_2') do
|
182
|
+
# y 6
|
183
|
+
# x 6
|
184
|
+
# width 15
|
185
|
+
# height 3
|
186
|
+
# end
|
179
187
|
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
188
|
+
# Composition.new(attributes[:test_0008]).to_s.must_equal(
|
189
|
+
# "\e[3;3H \e[3;3H" \
|
190
|
+
# "\e[4;3H \e[4;3H" \
|
191
|
+
# "\e[5;3H \e[5;3H" \
|
192
|
+
# "\e[3;3HSome text..." \
|
193
|
+
# "\e[4;3HSome text...\e[?25h" \
|
194
|
+
# "\e[3;3H \e[3;3H" \
|
195
|
+
# "\e[4;3H \e[4;3H" \
|
196
|
+
# "\e[5;3H \e[5;3H" \
|
197
|
+
# "\e[3;3HSome text..." \
|
198
|
+
# "\e[4;3HSome text...\e[?25h"
|
199
|
+
# )
|
200
|
+
# end
|
193
201
|
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
202
|
+
# it 'returns the stringified content for multiple interfaces, multiple lines, multiple streams' do
|
203
|
+
# Vedeu.interface('int2_lin2_str3_1') do
|
204
|
+
# y 3
|
205
|
+
# x 3
|
206
|
+
# width 30
|
207
|
+
# height 3
|
208
|
+
# end
|
209
|
+
# Vedeu.interface('int2_lin2_str3_2') do
|
210
|
+
# y 6
|
211
|
+
# x 6
|
212
|
+
# width 30
|
213
|
+
# height 3
|
214
|
+
# end
|
207
215
|
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
216
|
+
# Composition.new(attributes[:test_0009]).to_s.must_equal(
|
217
|
+
# "\e[3;3H \e[3;3H" \
|
218
|
+
# "\e[4;3H \e[4;3H" \
|
219
|
+
# "\e[5;3H \e[5;3H" \
|
220
|
+
# "\e[3;3HSome text... more text..." \
|
221
|
+
# "\e[4;3HSome text... more text...\e[?25h" \
|
222
|
+
# "\e[6;6H \e[6;6H" \
|
223
|
+
# "\e[7;6H \e[7;6H" \
|
224
|
+
# "\e[8;6H \e[8;6H" \
|
225
|
+
# "\e[6;6HSome text... more text..." \
|
226
|
+
# "\e[7;6HSome text... more text...\e[?25h"
|
227
|
+
# )
|
228
|
+
# end
|
221
229
|
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
230
|
+
# it 'returns the stringified content for multiple interfaces, multiple lines, multiple streams, streams contain styles' do
|
231
|
+
# Vedeu.interface('int2_lin2_str3_styles_1') do
|
232
|
+
# y 3
|
233
|
+
# x 3
|
234
|
+
# width 30
|
235
|
+
# height 3
|
236
|
+
# end
|
237
|
+
# Vedeu.interface('int2_lin2_str3_styles_2') do
|
238
|
+
# y 6
|
239
|
+
# x 6
|
240
|
+
# width 30
|
241
|
+
# height 3
|
242
|
+
# end
|
235
243
|
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
end
|
244
|
+
# Composition.new(attributes[:test_0010]).to_s.must_equal(
|
245
|
+
# "\e[3;3H \e[3;3H" \
|
246
|
+
# "\e[4;3H \e[4;3H" \
|
247
|
+
# "\e[5;3H \e[5;3H" \
|
248
|
+
# "\e[3;3H\e[38;2;0;0;0m\e[48;2;0;0;255m\e[24m\e[22m\e[27m\e[4mSome text...\e[38;2;255;255;0m\e[48;2;0;255;0m\e[24m\e[22m\e[27m \e[38;2;255;255;255m\e[48;2;255;0;255m\e[1mmore text..." \
|
249
|
+
# "\e[4;3H\e[38;2;0;0;0m\e[48;2;0;0;255m\e[24m\e[22m\e[27m\e[4mSome text...\e[38;2;255;255;0m\e[48;2;0;255;0m\e[24m\e[22m\e[27m \e[38;2;255;255;255m\e[48;2;255;0;255m\e[1mmore text...\e[?25h" \
|
250
|
+
# "\e[6;6H \e[6;6H" \
|
251
|
+
# "\e[7;6H \e[7;6H" \
|
252
|
+
# "\e[8;6H \e[8;6H" \
|
253
|
+
# "\e[6;6H\e[38;2;0;0;0m\e[48;2;0;0;255m\e[24m\e[22m\e[27m\e[4mSome text...\e[38;2;255;255;0m\e[48;2;0;255;0m\e[24m\e[22m\e[27m \e[38;2;255;255;255m\e[48;2;255;0;255m\e[1mmore text..." \
|
254
|
+
# "\e[7;6H\e[38;2;0;0;0m\e[48;2;0;0;255m\e[24m\e[22m\e[27m\e[4mSome text...\e[38;2;255;255;0m\e[48;2;0;255;0m\e[24m\e[22m\e[27m \e[38;2;255;255;255m\e[48;2;255;0;255m\e[1mmore text...\e[?25h"
|
255
|
+
# )
|
256
|
+
# end
|
257
|
+
# end
|
250
258
|
end
|
251
259
|
end
|