vedeu 0.4.50 → 0.4.51
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Guardfile +0 -5
- data/examples/material_colours_app.rb +1 -1
- data/examples/panel_app.rb +1 -1
- data/lib/vedeu/cli/generator/templates/application/config/configuration.erb +7 -2
- data/lib/vedeu/configuration/configuration.rb +1 -1
- data/lib/vedeu/output/border.rb +0 -6
- data/lib/vedeu/output/clear/named_interface.rb +2 -2
- data/lib/vedeu/output/output.rb +12 -12
- data/lib/vedeu/output/render_border.rb +1 -1
- data/lib/vedeu/output/renderers/all.rb +10 -5
- data/lib/vedeu/output/renderers/escape_sequence.rb +21 -23
- data/lib/vedeu/output/renderers/file.rb +16 -27
- data/lib/vedeu/output/renderers/html.rb +36 -42
- data/lib/vedeu/output/renderers/json.rb +22 -5
- data/lib/vedeu/output/renderers/null.rb +28 -3
- data/lib/vedeu/output/renderers/terminal.rb +23 -19
- data/lib/vedeu/output/renderers/text.rb +18 -20
- data/lib/vedeu/output/virtual_terminal.rb +1 -1
- data/lib/vedeu/support/template.rb +1 -1
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/application/application_controller_test.rb +2 -0
- data/test/lib/vedeu/application/application_helper_test.rb +2 -0
- data/test/lib/vedeu/application/controller_test.rb +1 -1
- data/test/lib/vedeu/application/helper_test.rb +2 -0
- data/test/lib/vedeu/application/view_test.rb +2 -0
- data/test/lib/vedeu/buffers/buffer_test.rb +1 -1
- data/test/lib/vedeu/buffers/display_buffer_test.rb +2 -0
- data/test/lib/vedeu/cli/generator/application_test.rb +2 -0
- data/test/lib/vedeu/cli/generator/helpers_test.rb +1 -0
- data/test/lib/vedeu/configuration/api_test.rb +3 -0
- data/test/lib/vedeu/cursor/move_test.rb +5 -0
- data/test/lib/vedeu/distributed/client_test.rb +4 -0
- data/test/lib/vedeu/distributed/server_test.rb +9 -0
- data/test/lib/vedeu/dsl/use_test.rb +4 -0
- data/test/lib/vedeu/launcher_test.rb +2 -0
- data/test/lib/vedeu/main_loop_test.rb +2 -0
- data/test/lib/vedeu/null/interface_test.rb +1 -0
- data/test/lib/vedeu/output/border_test.rb +0 -8
- data/test/lib/vedeu/output/output_test.rb +12 -11
- data/test/lib/vedeu/output/refresh_test.rb +1 -0
- data/test/lib/vedeu/output/render_border_test.rb +1 -0
- data/test/lib/vedeu/output/renderers/all_test.rb +4 -8
- data/test/lib/vedeu/output/renderers/escape_sequence_test.rb +5 -4
- data/test/lib/vedeu/output/renderers/file_test.rb +14 -19
- data/test/lib/vedeu/output/renderers/html_test.rb +55 -56
- data/test/lib/vedeu/output/renderers/json_test.rb +4 -5
- data/test/lib/vedeu/output/renderers/null_test.rb +9 -3
- data/test/lib/vedeu/output/renderers/terminal_test.rb +5 -4
- data/test/lib/vedeu/output/renderers/text_test.rb +5 -4
- data/test/lib/vedeu/output/text_test.rb +2 -0
- data/test/lib/vedeu/output/virtual_terminal_test.rb +10 -28
- data/test/lib/vedeu/repositories/collection_test.rb +1 -0
- data/test/lib/vedeu/repositories/model_test.rb +3 -0
- data/test/lib/vedeu/repositories/repository_test.rb +1 -0
- data/test/lib/vedeu/support/visibility_test.rb +1 -0
- data/test/lib/vedeu/traps_test.rb +1 -0
- data/test/lib/vedeu_test.rb +1 -0
- data/vedeu.gemspec +0 -2
- metadata +2 -30
@@ -20,20 +20,24 @@ module Vedeu
|
|
20
20
|
subject { model_instance.duplicate(_name) }
|
21
21
|
|
22
22
|
context 'when the model exists' do
|
23
|
+
# @todo
|
23
24
|
# it { skip }
|
24
25
|
end
|
25
26
|
|
26
27
|
context 'when the model does not exist' do
|
28
|
+
# @todo
|
27
29
|
# it { skip }
|
28
30
|
end
|
29
31
|
end
|
30
32
|
|
31
33
|
describe '#use' do
|
32
34
|
context 'when the model exists' do
|
35
|
+
# @todo
|
33
36
|
# it { skip }
|
34
37
|
end
|
35
38
|
|
36
39
|
context 'when the model does not exist' do
|
40
|
+
# @todo
|
37
41
|
# it { skip }
|
38
42
|
end
|
39
43
|
end
|
@@ -28,10 +28,12 @@ module Vedeu
|
|
28
28
|
subject { instance.debug_execute! }
|
29
29
|
|
30
30
|
context 'when debugging is enabled in the configuration' do
|
31
|
+
# @todo
|
31
32
|
# it { skip }
|
32
33
|
end
|
33
34
|
|
34
35
|
context 'when debugging is not enabled in the configuration' do
|
36
|
+
# @todo
|
35
37
|
# it { skip }
|
36
38
|
end
|
37
39
|
end
|
@@ -5,45 +5,46 @@ module Vedeu
|
|
5
5
|
describe Output do
|
6
6
|
|
7
7
|
let(:described) { Vedeu::Output }
|
8
|
-
let(:instance) { described.new(
|
9
|
-
let(:
|
8
|
+
let(:instance) { described.new(output) }
|
9
|
+
let(:output) {}
|
10
10
|
let(:drb) { false }
|
11
11
|
|
12
12
|
before do
|
13
13
|
Vedeu::Configuration.stubs(:drb?).returns(drb)
|
14
|
+
Vedeu.renderers.stubs(:render)
|
14
15
|
end
|
15
16
|
|
16
17
|
describe '#initialize' do
|
17
18
|
it { instance.must_be_instance_of(described) }
|
18
|
-
it { instance.instance_variable_get('@
|
19
|
+
it { instance.instance_variable_get('@output').must_equal(output) }
|
19
20
|
end
|
20
21
|
|
21
22
|
describe '.render' do
|
22
23
|
before { Vedeu.renderers.stubs(:render) }
|
23
24
|
|
24
|
-
subject { described.render(
|
25
|
+
subject { described.render(output) }
|
25
26
|
|
26
27
|
context 'when DRb is enabled' do
|
27
28
|
let(:drb) { true }
|
28
29
|
let(:virtual_buffer) { [] }
|
29
30
|
|
30
31
|
before do
|
31
|
-
Vedeu::Renderers::HTML.stubs(:to_file)
|
32
|
+
# Vedeu::Renderers::HTML.stubs(:to_file)
|
32
33
|
Vedeu::VirtualBuffer.stubs(:retrieve).returns(virtual_buffer)
|
33
34
|
end
|
34
35
|
|
35
36
|
it {
|
36
|
-
Vedeu.expects(:trigger).with(:_drb_store_output_,
|
37
|
+
Vedeu.expects(:trigger).with(:_drb_store_output_, output)
|
37
38
|
subject
|
38
39
|
}
|
39
40
|
|
40
|
-
it 'writes the virtual buffer to a file' do
|
41
|
-
|
42
|
-
|
43
|
-
end
|
41
|
+
# it 'writes the virtual buffer to a file' do
|
42
|
+
# Vedeu::Renderers::HTML.expects(:to_file).with(virtual_buffer)
|
43
|
+
# subject
|
44
|
+
# end
|
44
45
|
end
|
45
46
|
|
46
|
-
it { Vedeu.renderers.expects(:render).with(
|
47
|
+
it { Vedeu.renderers.expects(:render).with(output); subject }
|
47
48
|
end
|
48
49
|
|
49
50
|
end # Output
|
@@ -17,6 +17,7 @@ module Vedeu
|
|
17
17
|
describe Renderers do
|
18
18
|
|
19
19
|
let(:described) { Vedeu::Renderers }
|
20
|
+
let(:output) {}
|
20
21
|
|
21
22
|
before { Vedeu::Renderers.reset }
|
22
23
|
after { Vedeu::Renderers.reset }
|
@@ -29,14 +30,16 @@ module Vedeu
|
|
29
30
|
context 'API' do
|
30
31
|
before { Vedeu::Renderers.renderer(*renderers) }
|
31
32
|
|
32
|
-
subject { Vedeu.renderers.render }
|
33
|
+
subject { Vedeu.renderers.render(output) }
|
33
34
|
|
35
|
+
# @todo
|
34
36
|
# context 'when a single renderer is defined' do
|
35
37
|
# let(:renderers) { DummyRenderer }
|
36
38
|
|
37
39
|
# it { subject.must_equal([:dummy]) }
|
38
40
|
# end
|
39
41
|
|
42
|
+
# @todo
|
40
43
|
# context 'when multiple renderers are defined' do
|
41
44
|
# let(:renderers) { [DummyRenderer, FooRenderer] }
|
42
45
|
|
@@ -92,13 +95,6 @@ module Vedeu
|
|
92
95
|
it { subject.size.must_equal(0) }
|
93
96
|
end
|
94
97
|
|
95
|
-
describe '.storage' do
|
96
|
-
subject { described.storage }
|
97
|
-
|
98
|
-
it { subject.must_be_instance_of(Set) }
|
99
|
-
it { subject.size.must_equal(0) }
|
100
|
-
end
|
101
|
-
|
102
98
|
end # Renderers
|
103
99
|
|
104
100
|
end # Vedeu
|
@@ -7,16 +7,17 @@ module Vedeu
|
|
7
7
|
describe EscapeSequence do
|
8
8
|
|
9
9
|
let(:described) { Vedeu::Renderers::EscapeSequence }
|
10
|
-
let(:instance) { described.new(
|
10
|
+
let(:instance) { described.new(options) }
|
11
|
+
let(:options) { {} }
|
11
12
|
let(:output) {}
|
12
13
|
|
13
14
|
describe '#initialize' do
|
14
15
|
it { instance.must_be_instance_of(described) }
|
15
|
-
it { instance.instance_variable_get('@
|
16
|
+
it { instance.instance_variable_get('@options').must_equal(options) }
|
16
17
|
end
|
17
18
|
|
18
|
-
describe '
|
19
|
-
subject {
|
19
|
+
describe '#render' do
|
20
|
+
subject { instance.render(output) }
|
20
21
|
|
21
22
|
it { subject.must_be_instance_of(String) }
|
22
23
|
|
@@ -7,7 +7,7 @@ module Vedeu
|
|
7
7
|
describe File do
|
8
8
|
|
9
9
|
let(:described) { Vedeu::Renderers::File }
|
10
|
-
let(:instance) { described.new(
|
10
|
+
let(:instance) { described.new(options) }
|
11
11
|
let(:output) { 'Some content...' }
|
12
12
|
let(:options) {
|
13
13
|
{
|
@@ -20,27 +20,22 @@ module Vedeu
|
|
20
20
|
|
21
21
|
describe '#initialize' do
|
22
22
|
it { instance.must_be_instance_of(described) }
|
23
|
-
it { instance.instance_variable_get('@output').must_equal(output) }
|
24
23
|
it { instance.instance_variable_get('@options').must_equal(options) }
|
25
24
|
end
|
26
25
|
|
27
|
-
describe '.render' do
|
28
|
-
it { described.must_respond_to(:render) }
|
29
|
-
end
|
30
|
-
|
31
26
|
describe '#render' do
|
32
27
|
let(:_time) { Time.new(2015, 4, 12, 20, 05, 00, "+01:00") }
|
33
28
|
|
34
|
-
subject { instance.render }
|
29
|
+
subject { instance.render(output) }
|
35
30
|
|
36
31
|
it { subject.must_be_instance_of(String) }
|
37
32
|
|
38
33
|
context 'when the filename option is not set' do
|
39
34
|
context 'when the timestamp option is not set' do
|
40
|
-
it {
|
41
|
-
|
42
|
-
|
43
|
-
}
|
35
|
+
# it {
|
36
|
+
# ::File.expects(:write).with('/tmp/out', nil)
|
37
|
+
# subject
|
38
|
+
# }
|
44
39
|
end
|
45
40
|
|
46
41
|
context 'when the timestamp option is set' do
|
@@ -48,20 +43,20 @@ module Vedeu
|
|
48
43
|
|
49
44
|
before { Time.stubs(:now).returns(_time) }
|
50
45
|
|
51
|
-
it {
|
52
|
-
|
53
|
-
|
54
|
-
}
|
46
|
+
# it {
|
47
|
+
# ::File.expects(:write).with('/tmp/out_1428865500.0', 'w')
|
48
|
+
# subject
|
49
|
+
# }
|
55
50
|
end
|
56
51
|
end
|
57
52
|
|
58
53
|
context 'when the filename option is set' do
|
59
54
|
let(:filename) { 'some_name' }
|
60
55
|
|
61
|
-
it {
|
62
|
-
|
63
|
-
|
64
|
-
}
|
56
|
+
# it {
|
57
|
+
# ::File.expects(:write).with('/tmp/some_name', 'w')
|
58
|
+
# subject
|
59
|
+
# }
|
65
60
|
end
|
66
61
|
end
|
67
62
|
|
@@ -6,82 +6,80 @@ module Vedeu
|
|
6
6
|
|
7
7
|
describe HTML do
|
8
8
|
|
9
|
-
let(:described)
|
10
|
-
let(:instance)
|
11
|
-
let(:
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
9
|
+
let(:described) { Vedeu::Renderers::HTML }
|
10
|
+
let(:instance) { described.new(options) }
|
11
|
+
let(:options) {
|
12
|
+
{
|
13
|
+
content: content,
|
14
|
+
write_file: write_file,
|
15
|
+
}
|
16
|
+
}
|
17
|
+
let(:content) { [''] }
|
18
|
+
let(:write_file) { false }
|
16
19
|
|
17
20
|
describe '#initialize' do
|
18
21
|
it { instance.must_be_instance_of(described) }
|
19
|
-
it { instance.instance_variable_get('@
|
22
|
+
it { instance.instance_variable_get('@options').must_equal(options) }
|
20
23
|
end
|
21
24
|
|
22
|
-
describe '
|
23
|
-
|
24
|
-
end
|
25
|
+
# describe '#render' do
|
26
|
+
# before { ::File.stubs(:open) }
|
25
27
|
|
26
|
-
|
27
|
-
it { described.must_respond_to(:to_file) }
|
28
|
-
end
|
28
|
+
# subject { instance.render(content) }
|
29
29
|
|
30
|
-
|
31
|
-
before { ::File.stubs(:open) }
|
30
|
+
# it { subject.must_be_instance_of(String) }
|
32
31
|
|
33
|
-
|
32
|
+
# context 'when the :write_file option is true' do
|
33
|
+
# let(:write_file) { true }
|
34
34
|
|
35
|
-
|
36
|
-
|
35
|
+
# context 'when a path is given' do
|
36
|
+
# let(:path) { '/tmp/test_vedeu_html_renderer.html' }
|
37
37
|
|
38
|
-
|
39
|
-
|
38
|
+
# # it do
|
39
|
+
# # ::File.expects(:open)
|
40
|
+
# # subject
|
41
|
+
# # end
|
42
|
+
# end
|
40
43
|
|
41
|
-
|
44
|
+
# context 'when a path is not given' do
|
45
|
+
# let(:path) {}
|
46
|
+
# let(:_time) { Time.new(2015, 4, 12, 16, 55) }
|
42
47
|
|
43
|
-
|
44
|
-
let(:path) { '/tmp/test_vedeu_html_renderer.html' }
|
48
|
+
# before { Time.stubs(:now).returns(_time) }
|
45
49
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
50
|
+
# # it do
|
51
|
+
# # ::File.expects(:open)#.with('/tmp/vedeu_html_1428854100.html', 'w')
|
52
|
+
# # subject
|
53
|
+
# # end
|
54
|
+
# end
|
55
|
+
# end
|
51
56
|
|
52
|
-
|
53
|
-
|
54
|
-
let(:_time) { Time.new(2015, 4, 12, 16, 55) }
|
57
|
+
# context 'when the :write_file options is false' do
|
58
|
+
# let(:write_file) { false }
|
55
59
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
subject
|
61
|
-
end
|
62
|
-
end
|
63
|
-
end
|
60
|
+
# @todo
|
61
|
+
# # it { skip }
|
62
|
+
# end
|
63
|
+
# end
|
64
64
|
|
65
65
|
describe '#html_body' do
|
66
|
+
let(:content) {
|
67
|
+
[
|
68
|
+
[
|
69
|
+
Vedeu::Char.new(value: 't'),
|
70
|
+
Vedeu::Char.new(value: 'e'),
|
71
|
+
Vedeu::Char.new(value: 's'),
|
72
|
+
Vedeu::Char.new(value: 't'),
|
73
|
+
]
|
74
|
+
]
|
75
|
+
}
|
76
|
+
|
66
77
|
subject { instance.html_body }
|
67
78
|
|
68
79
|
it { subject.must_be_instance_of(String) }
|
69
80
|
|
70
|
-
it
|
71
|
-
|
72
|
-
context 'when there is output' do
|
73
|
-
let(:output) {
|
74
|
-
[
|
75
|
-
[
|
76
|
-
Vedeu::Char.new(value: 't'),
|
77
|
-
Vedeu::Char.new(value: 'e'),
|
78
|
-
Vedeu::Char.new(value: 's'),
|
79
|
-
Vedeu::Char.new(value: 't'),
|
80
|
-
]
|
81
|
-
]
|
82
|
-
}
|
83
|
-
|
84
|
-
it { subject.must_equal(
|
81
|
+
it do
|
82
|
+
subject.must_equal(
|
85
83
|
"<tr>\n" \
|
86
84
|
"<td style='background:#000;color:#222;border:1px #000 solid;'>" \
|
87
85
|
"t</td>\n" \
|
@@ -91,7 +89,8 @@ module Vedeu
|
|
91
89
|
"s</td>\n" \
|
92
90
|
"<td style='background:#000;color:#222;border:1px #000 solid;'>" \
|
93
91
|
"t</td>\n" \
|
94
|
-
"</tr>\n"
|
92
|
+
"</tr>\n"
|
93
|
+
)
|
95
94
|
end
|
96
95
|
end
|
97
96
|
|
@@ -7,18 +7,17 @@ module Vedeu
|
|
7
7
|
describe JSON do
|
8
8
|
|
9
9
|
let(:described) { Vedeu::Renderers::JSON }
|
10
|
-
let(:instance) { described.new(
|
11
|
-
let(:output) {}
|
10
|
+
let(:instance) { described.new(options) }
|
12
11
|
let(:options) { {} }
|
12
|
+
let(:output) {}
|
13
13
|
|
14
14
|
describe '#initialize' do
|
15
15
|
it { instance.must_be_instance_of(described) }
|
16
|
-
it { instance.instance_variable_get('@output').must_equal(output) }
|
17
16
|
it { instance.instance_variable_get('@options').must_equal(options) }
|
18
17
|
end
|
19
18
|
|
20
|
-
describe '
|
21
|
-
subject {
|
19
|
+
describe '#render' do
|
20
|
+
subject { instance.render(output) }
|
22
21
|
|
23
22
|
it { subject.must_be_instance_of(String) }
|
24
23
|
|