vedeu 0.8.9 → 0.8.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.codeclimate.yml +1 -0
- data/docs/configuration/drb.md +6 -0
- data/docs/configuration/drb_host.md +6 -0
- data/docs/configuration/drb_port.md +6 -0
- data/docs/configuration/interactive.md +21 -0
- data/docs/configuration/run_once.md +8 -0
- data/docs/configuration/standalone.md +20 -0
- data/docs/dsl.md +1 -1
- data/lib/vedeu.rb +15 -5
- data/lib/vedeu/application/controller.rb +5 -6
- data/lib/vedeu/borders/border.rb +1 -5
- data/lib/vedeu/borders/title.rb +6 -1
- data/lib/vedeu/buffers/buffer.rb +1 -3
- data/lib/vedeu/buffers/empty.rb +1 -3
- data/lib/vedeu/buffers/refresh.rb +1 -1
- data/lib/vedeu/buffers/view.rb +1 -1
- data/lib/vedeu/cells/border.rb +1 -1
- data/lib/vedeu/cells/borders/edges/bottom_horizontal.rb +1 -1
- data/lib/vedeu/cells/borders/edges/left_vertical.rb +1 -1
- data/lib/vedeu/cells/borders/edges/right_vertical.rb +1 -1
- data/lib/vedeu/cells/borders/edges/top_horizontal.rb +1 -1
- data/lib/vedeu/cells/borders/horizontal.rb +1 -1
- data/lib/vedeu/cells/borders/vertical.rb +1 -1
- data/lib/vedeu/cells/borders/vertices/bottom_left.rb +1 -1
- data/lib/vedeu/cells/borders/vertices/bottom_right.rb +1 -1
- data/lib/vedeu/cells/borders/vertices/top_left.rb +1 -1
- data/lib/vedeu/cells/borders/vertices/top_right.rb +1 -1
- data/lib/vedeu/cells/cursor.rb +1 -1
- data/lib/vedeu/cells/empty.rb +1 -1
- data/lib/vedeu/coercers/coercer.rb +8 -0
- data/lib/vedeu/coercers/colour.rb +6 -4
- data/lib/vedeu/coercers/editor_line.rb +4 -1
- data/lib/vedeu/coercers/editor_lines.rb +18 -3
- data/lib/vedeu/coercers/lines.rb +2 -1
- data/lib/vedeu/coercers/page.rb +2 -6
- data/lib/vedeu/coercers/position.rb +1 -3
- data/lib/vedeu/coercers/row.rb +0 -1
- data/lib/vedeu/colours/colour.rb +1 -2
- data/lib/vedeu/configuration/api.rb +6 -69
- data/lib/vedeu/configuration/configuration.rb +1 -4
- data/lib/vedeu/cursors/coordinate.rb +1 -3
- data/lib/vedeu/cursors/cursor.rb +4 -7
- data/lib/vedeu/cursors/reposition.rb +1 -1
- data/lib/vedeu/distributed/test_application.rb +1 -3
- data/lib/vedeu/dsl/border.rb +3 -4
- data/lib/vedeu/dsl/geometry.rb +6 -7
- data/lib/vedeu/dsl/helpers/align.rb +1 -1
- data/lib/vedeu/dsl/helpers/attributes.rb +2 -2
- data/lib/vedeu/dsl/helpers/truncate.rb +1 -2
- data/lib/vedeu/dsl/helpers/wordwrap.rb +1 -3
- data/lib/vedeu/dsl/presentation.rb +18 -0
- data/lib/vedeu/editor/cursor.rb +1 -3
- data/lib/vedeu/editor/document.rb +1 -3
- data/lib/vedeu/editor/line.rb +4 -12
- data/lib/vedeu/editor/lines.rb +3 -29
- data/lib/vedeu/events/event.rb +1 -3
- data/lib/vedeu/geometries/area/dimension.rb +1 -3
- data/lib/vedeu/geometries/area/x_dimension.rb +1 -1
- data/lib/vedeu/geometries/area/y_dimension.rb +1 -1
- data/lib/vedeu/geometries/geometry.rb +1 -4
- data/lib/vedeu/geometries/move.rb +1 -1
- data/lib/vedeu/groups/group.rb +4 -7
- data/lib/vedeu/input/keymap.rb +1 -3
- data/lib/vedeu/input/keys.rb +2 -0
- data/lib/vedeu/input/mapper.rb +2 -0
- data/lib/vedeu/input/mouse.rb +2 -0
- data/lib/vedeu/input/read.rb +1 -7
- data/lib/vedeu/interfaces/clear.rb +1 -1
- data/lib/vedeu/interfaces/interface.rb +11 -6
- data/lib/vedeu/logging/lockless_log_device.rb +18 -2
- data/lib/vedeu/logging/timer.rb +17 -9
- data/lib/vedeu/menus/menu.rb +1 -3
- data/lib/vedeu/models/toggleable.rb +5 -6
- data/lib/vedeu/output/all.rb +3 -0
- data/lib/vedeu/output/compressor.rb +1 -1
- data/lib/vedeu/output/output.rb +2 -3
- data/lib/vedeu/output/refresh.rb +1 -1
- data/lib/vedeu/output/write.rb +3 -2
- data/lib/vedeu/renderers/options.rb +1 -3
- data/lib/vedeu/repositories/defaults.rb +1 -1
- data/lib/vedeu/repositories/model.rb +5 -6
- data/lib/vedeu/repositories/registerable.rb +6 -8
- data/lib/vedeu/runtime/flags.rb +2 -2
- data/lib/vedeu/support/y_coordinate.rb +1 -1
- data/lib/vedeu/version.rb +1 -1
- data/lib/vedeu/views/composition.rb +1 -3
- data/lib/vedeu/views/default_attributes.rb +2 -4
- data/lib/vedeu/views/value.rb +6 -8
- data/lib/vedeu/views/view.rb +9 -3
- data/test/lib/vedeu/application/application_helper_test.rb +3 -2
- data/test/lib/vedeu/application/controller_test.rb +10 -11
- data/test/lib/vedeu/application/helper_test.rb +3 -2
- data/test/lib/vedeu/application/view_test.rb +4 -3
- data/test/lib/vedeu/coercers/editor_line_test.rb +21 -0
- data/test/lib/vedeu/coercers/editor_lines_test.rb +41 -0
- data/test/lib/vedeu/coercers/page_test.rb +1 -1
- data/test/lib/vedeu/cursors/dsl_test.rb +11 -10
- data/test/lib/vedeu/dsl/dsl_test.rb +3 -2
- data/test/lib/vedeu/dsl/elements_test.rb +19 -21
- data/test/lib/vedeu/dsl/presentation_test.rb +42 -0
- data/test/lib/vedeu/editor/collection_test.rb +5 -4
- data/test/lib/vedeu/editor/line_test.rb +4 -27
- data/test/lib/vedeu/editor/lines_test.rb +4 -54
- data/test/lib/vedeu/logging/timer_test.rb +11 -1
- data/test/lib/vedeu/models/toggleable_test.rb +27 -25
- data/test/lib/vedeu/output/compressor_cache_test.rb +0 -3
- data/test/lib/vedeu/presentation/colour_test.rb +13 -12
- data/test/lib/vedeu/presentation/presentation_test.rb +4 -2
- data/test/lib/vedeu/presentation/styles_test.rb +5 -3
- data/test/lib/vedeu/renderers/options_test.rb +10 -12
- data/test/lib/vedeu/repositories/assemblage_test.rb +11 -10
- data/test/lib/vedeu/repositories/collection_test.rb +1 -1
- data/test/lib/vedeu/repositories/defaults_test.rb +9 -7
- data/test/lib/vedeu/repositories/model_test.rb +10 -9
- data/test/lib/vedeu/repositories/registerable_test.rb +19 -18
- data/test/lib/vedeu/repositories/repository_test.rb +7 -7
- data/test/lib/vedeu/repositories/store_test.rb +14 -13
- data/test/lib/vedeu/templating/helpers_test.rb +9 -8
- data/test/lib/vedeu/views/default_attributes_test.rb +17 -17
- data/test/lib/vedeu/views/value_test.rb +0 -1
- data/test/support/helpers/model_test_class.rb +1 -2
- metadata +8 -2
@@ -23,13 +23,14 @@ module Vedeu
|
|
23
23
|
describe DSL do
|
24
24
|
|
25
25
|
let(:described) { Vedeu::DSL }
|
26
|
-
let(:
|
26
|
+
let(:included_described) { Vedeu::DSLModuleTestClass }
|
27
|
+
let(:included_instance) { included_described.new(model, client) }
|
27
28
|
let(:model) { Vedeu::DSLModelTestClass.new(_name) }
|
28
29
|
let(:client) {}
|
29
30
|
let(:_name) {}
|
30
31
|
|
31
32
|
describe '#name' do
|
32
|
-
subject {
|
33
|
+
subject { included_instance.name }
|
33
34
|
|
34
35
|
context 'when the model is nil' do
|
35
36
|
let(:model) {}
|
@@ -20,12 +20,10 @@ module Vedeu
|
|
20
20
|
|
21
21
|
describe Elements do
|
22
22
|
|
23
|
-
let(:described)
|
24
|
-
let(:
|
25
|
-
|
26
|
-
let(:
|
27
|
-
let(:including_instance) { including_described.new(model) }
|
28
|
-
let(:model) {}
|
23
|
+
let(:described) { Vedeu::DSL::Elements }
|
24
|
+
let(:included_described) { Vedeu::DSL::ElementsTest }
|
25
|
+
let(:included_instance) { included_described.new(model) }
|
26
|
+
let(:model) {}
|
29
27
|
|
30
28
|
describe '#centre' do
|
31
29
|
let(:_value) {}
|
@@ -35,7 +33,7 @@ module Vedeu
|
|
35
33
|
}
|
36
34
|
}
|
37
35
|
|
38
|
-
subject {
|
36
|
+
subject { included_instance.centre(_value, opts) }
|
39
37
|
|
40
38
|
context 'when a model exists' do
|
41
39
|
end
|
@@ -46,7 +44,7 @@ module Vedeu
|
|
46
44
|
end
|
47
45
|
|
48
46
|
describe '#center' do
|
49
|
-
it {
|
47
|
+
it { included_instance.must_respond_to(:center) }
|
50
48
|
end
|
51
49
|
|
52
50
|
describe '#left' do
|
@@ -57,7 +55,7 @@ module Vedeu
|
|
57
55
|
}
|
58
56
|
}
|
59
57
|
|
60
|
-
subject {
|
58
|
+
subject { included_instance.left(_value, opts) }
|
61
59
|
|
62
60
|
context 'when a model exists' do
|
63
61
|
end
|
@@ -75,7 +73,7 @@ module Vedeu
|
|
75
73
|
}
|
76
74
|
}
|
77
75
|
|
78
|
-
subject {
|
76
|
+
subject { included_instance.right(_value, opts) }
|
79
77
|
|
80
78
|
context 'when a model exists' do
|
81
79
|
end
|
@@ -88,7 +86,7 @@ module Vedeu
|
|
88
86
|
describe '#lines' do
|
89
87
|
let(:opts) { {} }
|
90
88
|
|
91
|
-
subject {
|
89
|
+
subject { included_instance.lines(opts) { } }
|
92
90
|
|
93
91
|
context 'when the block is given' do
|
94
92
|
context 'when a model exists' do
|
@@ -101,20 +99,20 @@ module Vedeu
|
|
101
99
|
end
|
102
100
|
|
103
101
|
context 'when the block is not given' do
|
104
|
-
subject {
|
102
|
+
subject { included_instance.lines }
|
105
103
|
|
106
104
|
it { proc { subject }.must_raise(Vedeu::Error::RequiresBlock) }
|
107
105
|
end
|
108
106
|
|
109
107
|
context 'when the opts parameter is not given' do
|
110
|
-
subject {
|
108
|
+
subject { included_instance.lines { } }
|
111
109
|
|
112
110
|
# @todo Add more tests.
|
113
111
|
end
|
114
112
|
end
|
115
113
|
|
116
114
|
describe '#line' do
|
117
|
-
subject {
|
115
|
+
subject { included_instance.line { } }
|
118
116
|
|
119
117
|
context 'when a model exists' do
|
120
118
|
let(:model) { Vedeu::Views::View.new }
|
@@ -124,7 +122,7 @@ module Vedeu
|
|
124
122
|
end
|
125
123
|
|
126
124
|
context 'when the block is not given' do
|
127
|
-
subject {
|
125
|
+
subject { included_instance.line }
|
128
126
|
|
129
127
|
# @todo Add more tests.
|
130
128
|
end
|
@@ -138,7 +136,7 @@ module Vedeu
|
|
138
136
|
describe '#streams' do
|
139
137
|
let(:opts) { {} }
|
140
138
|
|
141
|
-
subject {
|
139
|
+
subject { included_instance.streams(opts) { } }
|
142
140
|
|
143
141
|
context 'when the block is given' do
|
144
142
|
context 'when a model exists' do
|
@@ -153,20 +151,20 @@ module Vedeu
|
|
153
151
|
end
|
154
152
|
|
155
153
|
context 'when the block is not given' do
|
156
|
-
subject {
|
154
|
+
subject { included_instance.streams }
|
157
155
|
|
158
156
|
it { proc { subject }.must_raise(Vedeu::Error::RequiresBlock) }
|
159
157
|
end
|
160
158
|
|
161
159
|
context 'when the opts parameter is not given' do
|
162
|
-
subject {
|
160
|
+
subject { included_instance.streams { } }
|
163
161
|
|
164
162
|
# @todo Add more tests.
|
165
163
|
end
|
166
164
|
end
|
167
165
|
|
168
166
|
describe '#stream' do
|
169
|
-
subject {
|
167
|
+
subject { included_instance.stream { } }
|
170
168
|
|
171
169
|
context 'when a model exists' do
|
172
170
|
let(:model) { Vedeu::Views::View.new }
|
@@ -176,7 +174,7 @@ module Vedeu
|
|
176
174
|
end
|
177
175
|
|
178
176
|
context 'when the block is not given' do
|
179
|
-
subject {
|
177
|
+
subject { included_instance.stream }
|
180
178
|
|
181
179
|
# @todo Add more tests.
|
182
180
|
end
|
@@ -195,7 +193,7 @@ module Vedeu
|
|
195
193
|
}
|
196
194
|
}
|
197
195
|
|
198
|
-
subject {
|
196
|
+
subject { included_instance.text(_value, opts) }
|
199
197
|
|
200
198
|
context 'when a model exists' do
|
201
199
|
end
|
@@ -118,6 +118,12 @@ module Vedeu
|
|
118
118
|
it { instance.must_respond_to(:colour=) }
|
119
119
|
end
|
120
120
|
|
121
|
+
describe '#no_wordwrap!' do
|
122
|
+
it { instance.must_respond_to(:no_wordwrap!) }
|
123
|
+
|
124
|
+
# @todo Add more tests.
|
125
|
+
end
|
126
|
+
|
121
127
|
describe '#style' do
|
122
128
|
let(:args) { :bold }
|
123
129
|
|
@@ -138,6 +144,42 @@ module Vedeu
|
|
138
144
|
it { instance.must_respond_to(:styles=) }
|
139
145
|
end
|
140
146
|
|
147
|
+
describe '#wordwrap' do
|
148
|
+
context 'when the value is not given' do
|
149
|
+
subject { instance.wordwrap }
|
150
|
+
|
151
|
+
it { subject.must_equal(true) }
|
152
|
+
end
|
153
|
+
|
154
|
+
context 'when the value is given' do
|
155
|
+
subject { instance.wordwrap(_value) }
|
156
|
+
|
157
|
+
context 'when the value is nil' do
|
158
|
+
let(:_value) { nil }
|
159
|
+
|
160
|
+
it { subject.must_equal(false) }
|
161
|
+
end
|
162
|
+
|
163
|
+
context 'when the value is false' do
|
164
|
+
let(:_value) { false }
|
165
|
+
|
166
|
+
it { subject.must_equal(false) }
|
167
|
+
end
|
168
|
+
|
169
|
+
context 'when the value evaluates as true' do
|
170
|
+
let(:_value) { :a_true_value }
|
171
|
+
|
172
|
+
it { subject.must_equal(true) }
|
173
|
+
end
|
174
|
+
end
|
175
|
+
|
176
|
+
it { instance.must_respond_to(:wordwrap) }
|
177
|
+
end
|
178
|
+
|
179
|
+
describe '#wordwrap!' do
|
180
|
+
it { instance.must_respond_to(:wordwrap!) }
|
181
|
+
end
|
182
|
+
|
141
183
|
end # Presentation
|
142
184
|
|
143
185
|
end # DSL
|
@@ -21,14 +21,15 @@ module Vedeu
|
|
21
21
|
|
22
22
|
describe Collection do
|
23
23
|
|
24
|
-
let(:described)
|
25
|
-
let(:
|
26
|
-
let(:
|
24
|
+
let(:described) { Vedeu::Editor::Collection }
|
25
|
+
let(:included_described) { Vedeu::Editor::CollectionTestClass }
|
26
|
+
let(:included_instance) { included_described.new(collection) }
|
27
|
+
let(:collection) { 'Some text...'.chars }
|
27
28
|
|
28
29
|
describe '#by_index' do
|
29
30
|
let(:index) { 0 }
|
30
31
|
|
31
|
-
subject {
|
32
|
+
subject { included_instance.by_index(index) }
|
32
33
|
|
33
34
|
it { subject.must_be_instance_of(String) }
|
34
35
|
end
|
@@ -23,6 +23,10 @@ module Vedeu
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
+
describe '.coerce' do
|
27
|
+
it { described.must_respond_to(:coerce) }
|
28
|
+
end
|
29
|
+
|
26
30
|
describe '#collection' do
|
27
31
|
it { instance.must_respond_to(:collection) }
|
28
32
|
end
|
@@ -31,33 +35,6 @@ module Vedeu
|
|
31
35
|
it { instance.must_respond_to(:collection=) }
|
32
36
|
end
|
33
37
|
|
34
|
-
describe '.coerce' do
|
35
|
-
let(:_value) {}
|
36
|
-
|
37
|
-
subject { described.coerce(_value) }
|
38
|
-
|
39
|
-
it { subject.must_be_instance_of(Vedeu::Editor::Line) }
|
40
|
-
|
41
|
-
context 'when the value is already a Vedeu::Editor::Line object' do
|
42
|
-
let(:_value) { Vedeu::Editor::Line.new(collection) }
|
43
|
-
|
44
|
-
it { subject.must_equal(_value) }
|
45
|
-
it { subject.collection.must_equal(collection) }
|
46
|
-
end
|
47
|
-
|
48
|
-
context 'when the value is an empty String' do
|
49
|
-
let(:_value) { '' }
|
50
|
-
|
51
|
-
it { subject.collection.must_equal('') }
|
52
|
-
end
|
53
|
-
|
54
|
-
context 'when the value is an String' do
|
55
|
-
let(:_value) { collection }
|
56
|
-
|
57
|
-
it { subject.collection.must_equal(collection) }
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
38
|
describe '#character' do
|
62
39
|
let(:index) { 5 }
|
63
40
|
|
@@ -29,6 +29,10 @@ module Vedeu
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
+
describe '.coerce' do
|
33
|
+
it { described.must_respond_to(:coerce) }
|
34
|
+
end
|
35
|
+
|
32
36
|
describe '#collection' do
|
33
37
|
it { instance.must_respond_to(:collection) }
|
34
38
|
end
|
@@ -41,60 +45,6 @@ module Vedeu
|
|
41
45
|
it { instance.must_respond_to(:lines) }
|
42
46
|
end
|
43
47
|
|
44
|
-
describe '.coerce' do
|
45
|
-
let(:document) {}
|
46
|
-
|
47
|
-
subject { described.coerce(document) }
|
48
|
-
|
49
|
-
it { subject.must_be_instance_of(described) }
|
50
|
-
|
51
|
-
context 'when the document is already a Vedeu::Editor::Lines object' do
|
52
|
-
let(:document) { Vedeu::Editor::Lines.new(collection) }
|
53
|
-
|
54
|
-
it { subject.must_equal(document) }
|
55
|
-
it { subject.collection.must_equal(collection) }
|
56
|
-
end
|
57
|
-
|
58
|
-
context 'when the document is an empty Array' do
|
59
|
-
let(:document) { [] }
|
60
|
-
|
61
|
-
it { subject.collection.must_equal([]) }
|
62
|
-
end
|
63
|
-
|
64
|
-
context 'when the document is an Array' do
|
65
|
-
let(:document) {
|
66
|
-
[
|
67
|
-
Vedeu::Editor::Line.new('Some text...'),
|
68
|
-
:more_text,
|
69
|
-
'Other text...',
|
70
|
-
]
|
71
|
-
}
|
72
|
-
let(:expected) {
|
73
|
-
[
|
74
|
-
Vedeu::Editor::Line.new('Some text...'),
|
75
|
-
Vedeu::Editor::Line.new(''),
|
76
|
-
Vedeu::Editor::Line.new('Other text...'),
|
77
|
-
]
|
78
|
-
}
|
79
|
-
|
80
|
-
it { subject.collection.must_equal(expected) }
|
81
|
-
end
|
82
|
-
|
83
|
-
context 'when the document is a String' do
|
84
|
-
let(:document) { "Some text...\nMore text..." }
|
85
|
-
|
86
|
-
context 'but it is empty' do
|
87
|
-
let(:document) { '' }
|
88
|
-
|
89
|
-
it { subject.must_equal(Vedeu::Editor::Lines.new) }
|
90
|
-
end
|
91
|
-
|
92
|
-
context 'but it has no line breaks' do
|
93
|
-
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
48
|
describe '#delete_character' do
|
99
49
|
let(:x) { 0 }
|
100
50
|
let(:y) { 0 }
|
@@ -51,7 +51,17 @@ module Vedeu
|
|
51
51
|
context 'when the block is not given' do
|
52
52
|
subject { instance.measure }
|
53
53
|
|
54
|
-
|
54
|
+
context 'when debugging is enabled' do
|
55
|
+
before { Vedeu.config.stubs(:debug?).returns(true) }
|
56
|
+
|
57
|
+
it { proc { subject }.must_raise(Vedeu::Error::RequiresBlock) }
|
58
|
+
end
|
59
|
+
|
60
|
+
context 'when debugging is disabled' do
|
61
|
+
before { Vedeu.config.stubs(:debug?).returns(false) }
|
62
|
+
|
63
|
+
it { subject.must_equal(nil) }
|
64
|
+
end
|
55
65
|
end
|
56
66
|
end
|
57
67
|
|
@@ -5,6 +5,7 @@ require 'test_helper'
|
|
5
5
|
module Vedeu
|
6
6
|
|
7
7
|
class ToggleableTestClass
|
8
|
+
|
8
9
|
include Vedeu::Toggleable
|
9
10
|
|
10
11
|
def initialize(boolean)
|
@@ -14,79 +15,80 @@ module Vedeu
|
|
14
15
|
def store
|
15
16
|
self
|
16
17
|
end
|
17
|
-
|
18
|
+
|
19
|
+
end # ToggleableTestClass
|
18
20
|
|
19
21
|
describe Toggleable do
|
20
22
|
|
21
23
|
let(:described) { Vedeu::Toggleable }
|
22
|
-
let(:
|
23
|
-
let(:
|
24
|
+
let(:included_described) { Vedeu::ToggleableTestClass }
|
25
|
+
let(:included_instance) { included_described.new(visible) }
|
24
26
|
let(:visible) { false }
|
25
27
|
|
26
28
|
describe '#visible' do
|
27
|
-
it {
|
29
|
+
it { included_instance.must_respond_to(:visible) }
|
28
30
|
end
|
29
31
|
|
30
32
|
describe '#visible=' do
|
31
|
-
it {
|
33
|
+
it { included_instance.must_respond_to(:visible=) }
|
32
34
|
end
|
33
35
|
|
34
36
|
describe '#visible?' do
|
35
|
-
it {
|
37
|
+
it { included_instance.must_respond_to(:visible?) }
|
36
38
|
end
|
37
39
|
|
38
40
|
describe '#hide' do
|
39
|
-
subject {
|
41
|
+
subject { included_instance.hide }
|
40
42
|
|
41
43
|
it do
|
42
44
|
subject
|
43
|
-
|
45
|
+
included_instance.instance_variable_get('@visible').must_equal(false)
|
44
46
|
end
|
45
47
|
|
46
|
-
it {
|
47
|
-
it {
|
48
|
-
it {
|
48
|
+
it { included_described.must_respond_to(:hide_cursor) }
|
49
|
+
it { included_described.must_respond_to(:hide_group) }
|
50
|
+
it { included_described.must_respond_to(:hide_interface) }
|
49
51
|
end
|
50
52
|
|
51
53
|
describe '#show' do
|
52
|
-
subject {
|
54
|
+
subject { included_instance.show }
|
53
55
|
|
54
56
|
it do
|
55
57
|
subject
|
56
|
-
|
58
|
+
included_instance.instance_variable_get('@visible').must_equal(true)
|
57
59
|
end
|
58
60
|
|
59
|
-
it {
|
60
|
-
it {
|
61
|
-
it {
|
61
|
+
it { included_described.must_respond_to(:show_cursor) }
|
62
|
+
it { included_described.must_respond_to(:show_group) }
|
63
|
+
it { included_described.must_respond_to(:show_interface) }
|
62
64
|
end
|
63
65
|
|
64
66
|
describe '#toggle' do
|
65
|
-
subject {
|
67
|
+
subject { included_instance.toggle }
|
66
68
|
|
67
|
-
it {
|
68
|
-
it {
|
69
|
-
it {
|
69
|
+
it { included_described.must_respond_to(:toggle_cursor) }
|
70
|
+
it { included_described.must_respond_to(:toggle_group) }
|
71
|
+
it { included_described.must_respond_to(:toggle_interface) }
|
70
72
|
|
71
73
|
context 'when the model is visible' do
|
72
74
|
let(:visible) { true }
|
73
75
|
|
74
76
|
it do
|
75
77
|
subject
|
76
|
-
|
78
|
+
included_instance.instance_variable_get('@visible').must_equal(false)
|
77
79
|
end
|
78
80
|
end
|
79
81
|
|
80
82
|
context 'when the model is not visible' do
|
81
83
|
it do
|
82
84
|
subject
|
83
|
-
|
85
|
+
included_instance.instance_variable_get('@visible').must_equal(true)
|
84
86
|
end
|
85
87
|
end
|
86
88
|
end
|
87
89
|
|
88
90
|
describe '.hide_cursor' do
|
89
|
-
subject {
|
91
|
+
subject { included_described.hide_cursor }
|
90
92
|
|
91
93
|
context 'when the cursor is visible' do
|
92
94
|
# @todo Add more tests.
|
@@ -98,7 +100,7 @@ module Vedeu
|
|
98
100
|
end
|
99
101
|
|
100
102
|
describe '.show_cursor' do
|
101
|
-
subject {
|
103
|
+
subject { included_described.show_cursor }
|
102
104
|
|
103
105
|
context 'when the cursor is visible' do
|
104
106
|
# @todo Add more tests.
|
@@ -110,7 +112,7 @@ module Vedeu
|
|
110
112
|
end
|
111
113
|
|
112
114
|
describe '.toggle_cursor' do
|
113
|
-
subject {
|
115
|
+
subject { included_described.toggle_cursor }
|
114
116
|
|
115
117
|
context 'when the cursor is visible' do
|
116
118
|
# @todo Add more tests.
|