vedeu 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/dsl.md +3 -3
- data/examples/borders_app.rb +2 -0
- data/examples/colours_app.rb +2 -0
- data/examples/configuration_app.rb +2 -0
- data/examples/drb_app.rb +2 -0
- data/examples/focus_app.rb +2 -0
- data/examples/hello_world.rb +2 -0
- data/examples/material_colours_app.rb +2 -0
- data/lib/vedeu.rb +2 -0
- data/lib/vedeu/all.rb +4 -13
- data/lib/vedeu/api.rb +7 -6
- data/lib/vedeu/borders/border.rb +1 -1
- data/lib/vedeu/borders/render_border.rb +18 -18
- data/lib/vedeu/buffers/buffer.rb +18 -28
- data/lib/vedeu/colours/colour.rb +1 -1
- data/lib/vedeu/colours/colour_translator.rb +1 -1
- data/lib/vedeu/cursor/cursor.rb +9 -6
- data/lib/vedeu/dsl/border.rb +1 -1
- data/lib/vedeu/dsl/composition.rb +5 -5
- data/lib/vedeu/dsl/geometry.rb +1 -1
- data/lib/vedeu/dsl/group.rb +1 -1
- data/lib/vedeu/dsl/interface.rb +69 -93
- data/lib/vedeu/dsl/keymap.rb +1 -1
- data/lib/vedeu/dsl/line.rb +11 -11
- data/lib/vedeu/dsl/shared.rb +81 -0
- data/lib/vedeu/dsl/stream.rb +3 -3
- data/lib/vedeu/dsl/view.rb +76 -64
- data/lib/vedeu/models/escape.rb +1 -1
- data/lib/vedeu/models/interface.rb +3 -57
- data/lib/vedeu/models/menu.rb +1 -1
- data/lib/vedeu/models/views/all.rb +22 -0
- data/lib/vedeu/models/views/char.rb +175 -0
- data/lib/vedeu/models/views/chars.rb +13 -0
- data/lib/vedeu/models/views/composition.rb +73 -0
- data/lib/vedeu/models/views/line.rb +111 -0
- data/lib/vedeu/models/views/lines.rb +13 -0
- data/lib/vedeu/models/views/stream.rb +122 -0
- data/lib/vedeu/models/views/streams.rb +13 -0
- data/lib/vedeu/models/views/view.rb +157 -0
- data/lib/vedeu/models/views/view_collection.rb +13 -0
- data/lib/vedeu/null/view.rb +67 -0
- data/lib/vedeu/output/clear/named_interface.rb +4 -4
- data/lib/vedeu/output/compressor.rb +6 -6
- data/lib/vedeu/output/html_char.rb +6 -6
- data/lib/vedeu/output/output.rb +3 -3
- data/lib/vedeu/output/presentation.rb +1 -1
- data/lib/vedeu/output/renderers/escape_sequence.rb +1 -1
- data/lib/vedeu/output/renderers/file.rb +1 -1
- data/lib/vedeu/output/renderers/html.rb +3 -3
- data/lib/vedeu/output/renderers/json.rb +4 -4
- data/lib/vedeu/output/renderers/null.rb +1 -1
- data/lib/vedeu/output/renderers/terminal.rb +5 -5
- data/lib/vedeu/output/renderers/text.rb +3 -3
- data/lib/vedeu/output/style.rb +1 -1
- data/lib/vedeu/output/text.rb +20 -15
- data/lib/vedeu/output/viewport.rb +16 -23
- data/lib/vedeu/output/virtual_buffer.rb +9 -8
- data/lib/vedeu/output/virtual_terminal.rb +11 -11
- data/lib/vedeu/output/wordwrap.rb +5 -5
- data/lib/vedeu/runtime/application.rb +1 -1
- data/lib/vedeu/runtime/main_loop.rb +1 -1
- data/lib/vedeu/templating/helpers.rb +11 -10
- data/lib/vedeu/templating/template.rb +1 -1
- data/lib/vedeu/templating/view_template.rb +6 -6
- data/lib/vedeu/version.rb +1 -2
- data/test/lib/vedeu/api_test.rb +30 -30
- data/test/lib/vedeu/buffers/buffer_test.rb +5 -139
- data/test/lib/vedeu/colours/colour_translator_test.rb +3 -3
- data/test/lib/vedeu/configuration/api_test.rb +3 -3
- data/test/lib/vedeu/cursor/refresh_cursor_test.rb +1 -1
- data/test/lib/vedeu/dsl/composition_test.rb +7 -7
- data/test/lib/vedeu/dsl/group_test.rb +2 -2
- data/test/lib/vedeu/dsl/interface_test.rb +31 -21
- data/test/lib/vedeu/dsl/keymap_test.rb +4 -4
- data/test/lib/vedeu/dsl/line_test.rb +8 -8
- data/test/lib/vedeu/dsl/stream_test.rb +4 -4
- data/test/lib/vedeu/dsl/text_test.rb +11 -11
- data/test/lib/vedeu/dsl/view_test.rb +24 -29
- data/test/lib/vedeu/geometry/grid_test.rb +4 -4
- data/test/lib/vedeu/input/key_test.rb +1 -1
- data/test/lib/vedeu/internal_api_test.rb +18 -18
- data/test/lib/vedeu/models/focus_test.rb +54 -54
- data/test/lib/vedeu/models/interface_test.rb +11 -105
- data/test/lib/vedeu/models/menu_test.rb +1 -1
- data/test/lib/vedeu/models/views/char_test.rb +257 -0
- data/test/lib/vedeu/models/views/chars_test.rb +22 -0
- data/test/lib/vedeu/models/views/composition_test.rb +61 -0
- data/test/lib/vedeu/models/views/line_test.rb +189 -0
- data/test/lib/vedeu/models/views/lines_test.rb +22 -0
- data/test/lib/vedeu/models/views/stream_test.rb +138 -0
- data/test/lib/vedeu/models/views/streams_test.rb +22 -0
- data/test/lib/vedeu/models/views/view_test.rb +40 -0
- data/test/lib/vedeu/null/view_test.rb +12 -0
- data/test/lib/vedeu/output/clear/named_interface_test.rb +4 -4
- data/test/lib/vedeu/output/compressor_test.rb +28 -28
- data/test/lib/vedeu/output/html_char_test.rb +2 -2
- data/test/lib/vedeu/output/presentation_test.rb +10 -14
- data/test/lib/vedeu/output/renderers/escape_sequence_test.rb +20 -4
- data/test/lib/vedeu/output/renderers/html_test.rb +4 -4
- data/test/lib/vedeu/output/renderers/json_test.rb +3 -3
- data/test/lib/vedeu/output/text_test.rb +10 -10
- data/test/lib/vedeu/output/viewport_test.rb +21 -23
- data/test/lib/vedeu/output/virtual_buffer_test.rb +1 -1
- data/test/lib/vedeu/output/virtual_terminal_test.rb +1 -1
- data/test/lib/vedeu/output/wordwrap_test.rb +9 -9
- data/test/lib/vedeu/repositories/repository_test.rb +2 -2
- data/test/lib/vedeu/templating/helpers_test.rb +6 -39
- data/test/lib/vedeu/templating/template_test.rb +2 -2
- data/test/lib/vedeu/templating/view_template_test.rb +91 -91
- data/test/lib/vedeu/terminal_test.rb +1 -1
- metadata +33 -27
- data/lib/vedeu/buffers/display_buffer.rb +0 -39
- data/lib/vedeu/models/char.rb +0 -170
- data/lib/vedeu/models/chars.rb +0 -9
- data/lib/vedeu/models/composition.rb +0 -66
- data/lib/vedeu/models/line.rb +0 -112
- data/lib/vedeu/models/lines.rb +0 -9
- data/lib/vedeu/models/stream.rb +0 -122
- data/lib/vedeu/models/streams.rb +0 -9
- data/test/lib/vedeu/buffers/display_buffer_test.rb +0 -61
- data/test/lib/vedeu/models/char_test.rb +0 -253
- data/test/lib/vedeu/models/chars_test.rb +0 -18
- data/test/lib/vedeu/models/composition_test.rb +0 -57
- data/test/lib/vedeu/models/line_test.rb +0 -189
- data/test/lib/vedeu/models/lines_test.rb +0 -18
- data/test/lib/vedeu/models/stream_test.rb +0 -141
- data/test/lib/vedeu/models/streams_test.rb +0 -18
@@ -25,7 +25,7 @@ module Vedeu
|
|
25
25
|
@options = defaults.merge!(options)
|
26
26
|
end
|
27
27
|
|
28
|
-
# @return [Vedeu::Lines]
|
28
|
+
# @return [Vedeu::Views::Lines]
|
29
29
|
def content
|
30
30
|
case mode
|
31
31
|
when :prune then to_line_objects(prune)
|
@@ -94,16 +94,16 @@ module Vedeu
|
|
94
94
|
private
|
95
95
|
|
96
96
|
# @param text_as_lines [Array<String>]
|
97
|
-
# @return [Vedeu::Lines]
|
97
|
+
# @return [Vedeu::Views::Lines]
|
98
98
|
def to_line_objects(text_as_lines)
|
99
99
|
line_objects = Array(text_as_lines).map do |text_line|
|
100
|
-
stream = Vedeu::Stream.new(value: text_line)
|
101
|
-
line = Vedeu::Line.new
|
100
|
+
stream = Vedeu::Views::Stream.new(value: text_line)
|
101
|
+
line = Vedeu::Views::Line.new
|
102
102
|
stream.parent = line
|
103
103
|
line.add(stream)
|
104
104
|
line
|
105
105
|
end
|
106
|
-
Vedeu::Lines.new(line_objects)
|
106
|
+
Vedeu::Views::Lines.new(line_objects)
|
107
107
|
end
|
108
108
|
|
109
109
|
# @return [Array<String>]
|
@@ -40,7 +40,7 @@ module Vedeu
|
|
40
40
|
# :nocov:
|
41
41
|
# Check the application has started and we wish to continue running.
|
42
42
|
#
|
43
|
-
# @raise [VedeuInterrupt] When we wish to terminate the running
|
43
|
+
# @raise [Vedeu::VedeuInterrupt] When we wish to terminate the running
|
44
44
|
# application.
|
45
45
|
# @return [void]
|
46
46
|
def safe_exit_point!
|
@@ -8,10 +8,10 @@ module Vedeu
|
|
8
8
|
|
9
9
|
# @param value [String] The HTML/CSS colour.
|
10
10
|
# @param block [Proc]
|
11
|
-
# @return [Vedeu::Stream]
|
11
|
+
# @return [Vedeu::Views::Stream]
|
12
12
|
# @raise [Vedeu::InvalidSyntax] The required block was not given.
|
13
13
|
def background(value, &block)
|
14
|
-
define_stream(
|
14
|
+
define_stream(background: value, &block)
|
15
15
|
end
|
16
16
|
alias_method :bg, :background
|
17
17
|
|
@@ -19,7 +19,7 @@ module Vedeu
|
|
19
19
|
# @option attributes foreground [String] The HTML/CSS foreground colour.
|
20
20
|
# @option attributes background [String] The HTML/CSS background colour.
|
21
21
|
# @param block [Proc]
|
22
|
-
# @return [Vedeu::Stream]
|
22
|
+
# @return [Vedeu::Views::Stream]
|
23
23
|
# @raise [Vedeu::InvalidSyntax] The required block was not given.
|
24
24
|
def colour(attributes = {}, &block)
|
25
25
|
define_stream(attributes, &block)
|
@@ -27,18 +27,18 @@ module Vedeu
|
|
27
27
|
|
28
28
|
# @param value [String] The HTML/CSS colour.
|
29
29
|
# @param block [Proc]
|
30
|
-
# @return [Vedeu::Stream]
|
30
|
+
# @return [Vedeu::Views::Stream]
|
31
31
|
# @raise [Vedeu::InvalidSyntax] The required block was not given.
|
32
32
|
def foreground(value, &block)
|
33
|
-
define_stream(
|
33
|
+
define_stream(foreground: value, &block)
|
34
34
|
end
|
35
35
|
alias_method :fg, :foreground
|
36
36
|
|
37
37
|
# @param value [Symbol]
|
38
38
|
# @param block [Proc]
|
39
|
-
# @return [Vedeu::Stream]
|
39
|
+
# @return [Vedeu::Views::Stream]
|
40
40
|
def style(value, &block)
|
41
|
-
define_stream(
|
41
|
+
define_stream(style: value, &block)
|
42
42
|
end
|
43
43
|
|
44
44
|
private
|
@@ -48,9 +48,10 @@ module Vedeu
|
|
48
48
|
fail Vedeu::InvalidSyntax, 'block not given' unless block_given?
|
49
49
|
|
50
50
|
encode(
|
51
|
-
Vedeu::Stream.build(
|
52
|
-
|
53
|
-
|
51
|
+
Vedeu::Views::Stream.build(
|
52
|
+
colour: Vedeu::Colour.new(attributes),
|
53
|
+
style: Vedeu::Style.new(attributes[:style]),
|
54
|
+
value: block.call))
|
54
55
|
end
|
55
56
|
|
56
57
|
# @param data [String]
|
@@ -9,12 +9,12 @@ module Vedeu
|
|
9
9
|
include Vedeu::Common
|
10
10
|
include Vedeu::Templating::Helpers
|
11
11
|
|
12
|
-
# @return [Vedeu::Lines]
|
12
|
+
# @return [Vedeu::Views::Lines]
|
13
13
|
def parse
|
14
|
-
lines_collection = Vedeu::Lines.new
|
14
|
+
lines_collection = Vedeu::Views::Lines.new
|
15
15
|
|
16
16
|
lines.each do |line|
|
17
|
-
line_object = Vedeu::Line.new
|
17
|
+
line_object = Vedeu::Views::Line.new
|
18
18
|
|
19
19
|
streams_for(line).each do |stream|
|
20
20
|
next unless present?(stream)
|
@@ -23,9 +23,9 @@ module Vedeu
|
|
23
23
|
Vedeu::Templating::Decoder.process(stream)
|
24
24
|
|
25
25
|
else
|
26
|
-
Vedeu::Stream.new(colour: default_colour,
|
27
|
-
|
28
|
-
|
26
|
+
Vedeu::Views::Stream.new(colour: default_colour,
|
27
|
+
style: default_style,
|
28
|
+
value: stream)
|
29
29
|
|
30
30
|
end
|
31
31
|
end
|
data/lib/vedeu/version.rb
CHANGED
data/test/lib/vedeu/api_test.rb
CHANGED
@@ -4,55 +4,55 @@ module Vedeu
|
|
4
4
|
|
5
5
|
describe API do
|
6
6
|
|
7
|
-
it { Vedeu.must_respond_to(:
|
7
|
+
it { Vedeu.must_respond_to(:bind) }
|
8
|
+
it { Vedeu.must_respond_to(:bind_alias) }
|
9
|
+
it { Vedeu.must_respond_to(:border) }
|
10
|
+
it { Vedeu.must_respond_to(:bound?) }
|
11
|
+
it { Vedeu.must_respond_to(:clear) }
|
12
|
+
it { Vedeu.must_respond_to(:clear_by_group) }
|
13
|
+
it { Vedeu.must_respond_to(:clear_by_name) }
|
8
14
|
it { Vedeu.must_respond_to(:configuration) }
|
15
|
+
it { Vedeu.must_respond_to(:configure) }
|
9
16
|
it { Vedeu.must_respond_to(:cursor) }
|
10
17
|
it { Vedeu.must_respond_to(:drb_restart) }
|
11
18
|
it { Vedeu.must_respond_to(:drb_start) }
|
12
19
|
it { Vedeu.must_respond_to(:drb_status) }
|
13
20
|
it { Vedeu.must_respond_to(:drb_stop) }
|
14
|
-
it { Vedeu.must_respond_to(:border) }
|
15
|
-
it { Vedeu.must_respond_to(:geometry) }
|
16
|
-
it { Vedeu.must_respond_to(:group) }
|
17
|
-
it { Vedeu.must_respond_to(:keymap) }
|
18
|
-
it { Vedeu.must_respond_to(:interface) }
|
19
|
-
it { Vedeu.must_respond_to(:renders) }
|
20
|
-
it { Vedeu.must_respond_to(:render) }
|
21
|
-
it { Vedeu.must_respond_to(:views) }
|
22
|
-
it { Vedeu.must_respond_to(:view) }
|
23
|
-
it { Vedeu.must_respond_to(:bind) }
|
24
|
-
it { Vedeu.must_respond_to(:bind_alias) }
|
25
|
-
it { Vedeu.must_respond_to(:bound?) }
|
26
|
-
it { Vedeu.must_respond_to(:unbind) }
|
27
|
-
it { Vedeu.must_respond_to(:unbind_alias) }
|
28
21
|
it { Vedeu.must_respond_to(:events) }
|
22
|
+
it { Vedeu.must_respond_to(:exit) }
|
29
23
|
it { Vedeu.must_respond_to(:focus) }
|
30
24
|
it { Vedeu.must_respond_to(:focus_by_name) }
|
31
|
-
it { Vedeu.must_respond_to(:focussed?) }
|
32
25
|
it { Vedeu.must_respond_to(:focus_next) }
|
33
26
|
it { Vedeu.must_respond_to(:focus_previous) }
|
27
|
+
it { Vedeu.must_respond_to(:focussed?) }
|
28
|
+
it { Vedeu.must_respond_to(:geometry) }
|
34
29
|
it { Vedeu.must_respond_to(:goto) }
|
30
|
+
it { Vedeu.must_respond_to(:group) }
|
31
|
+
it { Vedeu.must_respond_to(:height) }
|
32
|
+
it { Vedeu.must_respond_to(:hide_cursor) }
|
33
|
+
it { Vedeu.must_respond_to(:hide_group) }
|
34
|
+
it { Vedeu.must_respond_to(:hide_interface) }
|
35
|
+
it { Vedeu.must_respond_to(:interface) }
|
36
|
+
it { Vedeu.must_respond_to(:keymap) }
|
37
|
+
it { Vedeu.must_respond_to(:keypress) }
|
35
38
|
it { Vedeu.must_respond_to(:log) }
|
36
|
-
it { Vedeu.must_respond_to(:log_stdout) }
|
37
39
|
it { Vedeu.must_respond_to(:log_stderr) }
|
38
|
-
it { Vedeu.must_respond_to(:
|
40
|
+
it { Vedeu.must_respond_to(:log_stdout) }
|
39
41
|
it { Vedeu.must_respond_to(:menu) }
|
40
|
-
it { Vedeu.must_respond_to(:
|
41
|
-
it { Vedeu.must_respond_to(:
|
42
|
-
it { Vedeu.must_respond_to(:trigger) }
|
43
|
-
it { Vedeu.must_respond_to(:exit) }
|
44
|
-
it { Vedeu.must_respond_to(:clear) }
|
45
|
-
it { Vedeu.must_respond_to(:clear_by_name) }
|
46
|
-
it { Vedeu.must_respond_to(:clear_by_group) }
|
47
|
-
it { Vedeu.must_respond_to(:hide_cursor) }
|
42
|
+
it { Vedeu.must_respond_to(:render) }
|
43
|
+
it { Vedeu.must_respond_to(:renders) }
|
48
44
|
it { Vedeu.must_respond_to(:show_cursor) }
|
49
|
-
it { Vedeu.must_respond_to(:toggle_cursor) }
|
50
|
-
it { Vedeu.must_respond_to(:hide_group) }
|
51
45
|
it { Vedeu.must_respond_to(:show_group) }
|
52
|
-
it { Vedeu.must_respond_to(:toggle_group) }
|
53
|
-
it { Vedeu.must_respond_to(:hide_interface) }
|
54
46
|
it { Vedeu.must_respond_to(:show_interface) }
|
47
|
+
it { Vedeu.must_respond_to(:toggle_cursor) }
|
48
|
+
it { Vedeu.must_respond_to(:toggle_group) }
|
55
49
|
it { Vedeu.must_respond_to(:toggle_interface) }
|
50
|
+
it { Vedeu.must_respond_to(:trigger) }
|
51
|
+
it { Vedeu.must_respond_to(:unbind) }
|
52
|
+
it { Vedeu.must_respond_to(:unbind_alias) }
|
53
|
+
it { Vedeu.must_respond_to(:views) }
|
54
|
+
it { Vedeu.must_respond_to(:width) }
|
55
|
+
|
56
56
|
end # API
|
57
57
|
|
58
58
|
end # Vedeu
|
@@ -42,50 +42,19 @@ module Vedeu
|
|
42
42
|
end
|
43
43
|
|
44
44
|
describe '#add' do
|
45
|
-
let(:
|
46
|
-
Vedeu.interface 'buffer' do
|
47
|
-
lines do
|
48
|
-
line 'old_back'
|
49
|
-
end
|
50
|
-
end
|
51
|
-
}
|
52
|
-
let(:content) {
|
53
|
-
Vedeu.interface 'buffer' do
|
54
|
-
lines do
|
55
|
-
line 'new_back'
|
56
|
-
end
|
57
|
-
end
|
58
|
-
}
|
59
|
-
|
60
|
-
before { Vedeu.stubs(:trigger) }
|
61
|
-
after { Vedeu.interfaces.reset }
|
45
|
+
let(:content) { Vedeu::Views::View.new(lines: [Vedeu::Views::Line.new]) }
|
62
46
|
|
63
47
|
subject { instance.add(content) }
|
64
48
|
|
65
49
|
it { subject.must_equal(true) }
|
66
|
-
|
67
|
-
it 'replaces the back buffer with the content' do
|
68
|
-
instance.back.must_equal(back)
|
69
|
-
|
70
|
-
subject
|
71
|
-
|
72
|
-
instance.back.must_equal(content)
|
73
|
-
end
|
74
50
|
end
|
75
51
|
|
76
52
|
describe '#back?' do
|
77
|
-
before { Vedeu.stubs(:trigger) }
|
78
|
-
after { Vedeu.interfaces.reset }
|
79
|
-
|
80
53
|
subject { instance.back? }
|
81
54
|
|
82
55
|
context 'with content' do
|
83
56
|
let(:back) {
|
84
|
-
Vedeu.
|
85
|
-
lines do
|
86
|
-
line 'back content'
|
87
|
-
end
|
88
|
-
end
|
57
|
+
Vedeu::Views::View.new(lines: [Vedeu::Views::Line.new])
|
89
58
|
}
|
90
59
|
|
91
60
|
it { subject.must_equal(true) }
|
@@ -97,19 +66,13 @@ module Vedeu
|
|
97
66
|
end
|
98
67
|
|
99
68
|
describe '#front?' do
|
100
|
-
before { Vedeu.stubs(:trigger) }
|
101
|
-
after { Vedeu.interfaces.reset }
|
102
|
-
|
103
69
|
subject { instance.front? }
|
104
70
|
|
105
71
|
context 'with content' do
|
106
72
|
let(:front) {
|
107
|
-
Vedeu.
|
108
|
-
lines do
|
109
|
-
line 'front content'
|
110
|
-
end
|
111
|
-
end
|
73
|
+
Vedeu::Views::View.new(lines: [Vedeu::Views::Line.new])
|
112
74
|
}
|
75
|
+
|
113
76
|
it { subject.must_equal(true) }
|
114
77
|
end
|
115
78
|
|
@@ -119,18 +82,11 @@ module Vedeu
|
|
119
82
|
end
|
120
83
|
|
121
84
|
describe '#previous?' do
|
122
|
-
before { Vedeu.stubs(:trigger) }
|
123
|
-
after { Vedeu.interfaces.reset }
|
124
|
-
|
125
85
|
subject { instance.previous? }
|
126
86
|
|
127
87
|
context 'with content' do
|
128
88
|
let(:previous) {
|
129
|
-
Vedeu.
|
130
|
-
lines do
|
131
|
-
line 'previous content'
|
132
|
-
end
|
133
|
-
end
|
89
|
+
Vedeu::Views::View.new(lines: [Vedeu::Views::Line.new])
|
134
90
|
}
|
135
91
|
|
136
92
|
it { subject.must_equal(true) }
|
@@ -172,96 +128,6 @@ module Vedeu
|
|
172
128
|
Vedeu::Output.expects(:render)
|
173
129
|
subject
|
174
130
|
}
|
175
|
-
|
176
|
-
# @todo Add more tests.
|
177
|
-
# it { skip }
|
178
|
-
# it { subject.must_be_instance_of(Array) }
|
179
|
-
|
180
|
-
# context 'when there is content on the back buffer' do
|
181
|
-
# let(:back) {
|
182
|
-
# Vedeu.interface 'buffer' do
|
183
|
-
# lines do
|
184
|
-
# line 'old_back'
|
185
|
-
# end
|
186
|
-
# end
|
187
|
-
# }
|
188
|
-
# let(:front) {
|
189
|
-
# Vedeu.interface 'buffer' do
|
190
|
-
# lines do
|
191
|
-
# line 'front'
|
192
|
-
# end
|
193
|
-
# end
|
194
|
-
# }
|
195
|
-
# let(:previous) {
|
196
|
-
# Vedeu.interface 'buffer' do
|
197
|
-
# lines do
|
198
|
-
# line 'previous'
|
199
|
-
# end
|
200
|
-
# end
|
201
|
-
# }
|
202
|
-
# let(:buffer) { :back }
|
203
|
-
|
204
|
-
# it { subject.must_equal([back]) }
|
205
|
-
|
206
|
-
# it 'replaces the previous buffer with the front buffer' do
|
207
|
-
# subject
|
208
|
-
# instance.previous.must_equal(front)
|
209
|
-
# end
|
210
|
-
|
211
|
-
# it 'replaces the front buffer with the back buffer' do
|
212
|
-
# subject
|
213
|
-
# instance.front.must_equal(back)
|
214
|
-
# end
|
215
|
-
|
216
|
-
# it 'replaces the back buffer with an empty buffer' do
|
217
|
-
# subject
|
218
|
-
# instance.back.must_equal(nil)
|
219
|
-
# end
|
220
|
-
# end
|
221
|
-
|
222
|
-
# context 'when there is no content on the back buffer' do
|
223
|
-
# let(:buffer) { :back }
|
224
|
-
|
225
|
-
# it { subject.must_equal([]) }
|
226
|
-
# end
|
227
|
-
|
228
|
-
# context 'when there is content on the front buffer' do
|
229
|
-
# let(:buffer) { :front }
|
230
|
-
# let(:front) {
|
231
|
-
# Vedeu.interface 'buffer' do
|
232
|
-
# lines do
|
233
|
-
# line 'front'
|
234
|
-
# end
|
235
|
-
# end
|
236
|
-
# }
|
237
|
-
|
238
|
-
# it { subject.must_equal([front]) }
|
239
|
-
# end
|
240
|
-
|
241
|
-
# context 'when there is no content on the front buffer' do
|
242
|
-
# let(:buffer) { :front }
|
243
|
-
|
244
|
-
# it { subject.must_equal([]) }
|
245
|
-
# end
|
246
|
-
|
247
|
-
# context 'when there is content on the previous buffer' do
|
248
|
-
# let(:buffer) { :previous }
|
249
|
-
# let(:previous) {
|
250
|
-
# Vedeu.interface 'buffer' do
|
251
|
-
# lines do
|
252
|
-
# line 'old_back'
|
253
|
-
# end
|
254
|
-
# end
|
255
|
-
# }
|
256
|
-
|
257
|
-
# it { subject.must_equal([previous]) }
|
258
|
-
# end
|
259
|
-
|
260
|
-
# context 'when there is no content on the previous buffer' do
|
261
|
-
# let(:buffer) { :previous }
|
262
|
-
|
263
|
-
# it { subject.must_equal([]) }
|
264
|
-
# end
|
265
131
|
end
|
266
132
|
|
267
133
|
end # Buffer
|
@@ -84,7 +84,7 @@ module Vedeu
|
|
84
84
|
|
85
85
|
it 'raises an exception since the subclasses Background and ' \
|
86
86
|
'Foreground handle this' do
|
87
|
-
proc { subject }.must_raise(NotImplemented)
|
87
|
+
proc { subject }.must_raise(Vedeu::NotImplemented)
|
88
88
|
end
|
89
89
|
end
|
90
90
|
|
@@ -93,7 +93,7 @@ module Vedeu
|
|
93
93
|
|
94
94
|
it 'raises an exception since the subclasses Background and ' \
|
95
95
|
'Foreground handle this' do
|
96
|
-
proc { subject }.must_raise(NotImplemented)
|
96
|
+
proc { subject }.must_raise(Vedeu::NotImplemented)
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
@@ -102,7 +102,7 @@ module Vedeu
|
|
102
102
|
|
103
103
|
it 'raises an exception since the subclasses Background and ' \
|
104
104
|
'Foreground handle this' do
|
105
|
-
proc { subject }.must_raise(NotImplemented)
|
105
|
+
proc { subject }.must_raise(Vedeu::NotImplemented)
|
106
106
|
end
|
107
107
|
end
|
108
108
|
|