vedeu 0.4.40 → 0.4.41
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Dockerfile +23 -28
- data/Guardfile +0 -8
- data/Rakefile +0 -6
- data/docs/applications.md +0 -1
- data/docs/dsl.md +7 -12
- data/examples/borders_app.rb +5 -0
- data/examples/configuration_app.rb +5 -0
- data/examples/drb_app.rb +5 -0
- data/examples/geometry_app.rb +5 -0
- data/examples/material_colours_app.rb +5 -0
- data/examples/panel_app.rb +5 -0
- data/examples/typed_commands/typed_commands_app.rb +5 -0
- data/examples/view_templates_app/view_templates_app.rb +5 -0
- data/lib/vedeu/api.rb +8 -8
- data/lib/vedeu/application/all.rb +3 -0
- data/lib/vedeu/application/application_controller.rb +4 -0
- data/lib/vedeu/application/application_helper.rb +4 -0
- data/lib/vedeu/application/application_view.rb +6 -0
- data/lib/vedeu/application/controller.rb +23 -0
- data/lib/vedeu/application/helper.rb +23 -0
- data/lib/vedeu/application/view.rb +23 -0
- data/lib/vedeu/application.rb +1 -3
- data/lib/vedeu/bindings.rb +64 -65
- data/lib/vedeu/bootstrap.rb +2 -0
- data/lib/vedeu/buffers/buffer.rb +44 -0
- data/lib/vedeu/configuration/api.rb +44 -119
- data/lib/vedeu/configuration/cli.rb +2 -0
- data/lib/vedeu/configuration/configuration.rb +4 -20
- data/lib/vedeu/cursor/cursor.rb +7 -7
- data/lib/vedeu/cursor/reposition.rb +2 -0
- data/lib/vedeu/dsl/border.rb +58 -2
- data/lib/vedeu/dsl/composition.rb +5 -3
- data/lib/vedeu/dsl/geometry.rb +14 -5
- data/lib/vedeu/dsl/group.rb +2 -0
- data/lib/vedeu/dsl/interface.rb +23 -3
- data/lib/vedeu/dsl/keymap.rb +11 -6
- data/lib/vedeu/dsl/line.rb +8 -0
- data/lib/vedeu/dsl/menu.rb +3 -1
- data/lib/vedeu/dsl/presentation.rb +12 -3
- data/lib/vedeu/dsl/text.rb +2 -0
- data/lib/vedeu/dsl/view.rb +6 -1
- data/lib/vedeu/events/event.rb +3 -1
- data/lib/vedeu/generator/application.rb +2 -7
- data/lib/vedeu/generator/templates/application/app/models/keymaps/_global_.rb +5 -0
- data/lib/vedeu/generator/templates/application/app/views/interfaces/name.erb +10 -0
- data/lib/vedeu/generator/view.rb +2 -0
- data/lib/vedeu/geometry/geometry.rb +14 -0
- data/lib/vedeu/geometry/index_position.rb +1 -0
- data/lib/vedeu/geometry/position.rb +5 -0
- data/lib/vedeu/input/all.rb +0 -8
- data/lib/vedeu/input/input.rb +24 -8
- data/lib/vedeu/input/mapper.rb +5 -12
- data/lib/vedeu/models/composition.rb +3 -3
- data/lib/vedeu/models/escape_char.rb +2 -0
- data/lib/vedeu/models/focus.rb +8 -0
- data/lib/vedeu/models/interface.rb +1 -1
- data/lib/vedeu/models/line.rb +1 -5
- data/lib/vedeu/models/menu.rb +4 -2
- data/lib/vedeu/models/panel.rb +2 -0
- data/lib/vedeu/null/buffer.rb +2 -0
- data/lib/vedeu/null/interface.rb +2 -0
- data/lib/vedeu/output/background.rb +1 -1
- data/lib/vedeu/output/border.rb +5 -157
- data/lib/vedeu/output/compressor.rb +2 -0
- data/lib/vedeu/output/foreground.rb +1 -1
- data/lib/vedeu/output/refresh.rb +5 -9
- data/lib/vedeu/output/render_border.rb +230 -0
- data/lib/vedeu/output/renderers/escape_sequence.rb +2 -3
- data/lib/vedeu/output/renderers/file.rb +10 -9
- data/lib/vedeu/repositories/collections/all.rb +4 -4
- data/lib/vedeu/repositories/repositories/all.rb +4 -4
- data/lib/vedeu/repositories/repositories/{background_colours.rb → backgrounds.rb} +3 -3
- data/lib/vedeu/repositories/repositories/cursors.rb +3 -0
- data/lib/vedeu/repositories/repositories/{events_repository.rb → events.rb} +5 -5
- data/lib/vedeu/repositories/repositories/{foreground_colours.rb → foregrounds.rb} +3 -3
- data/lib/vedeu/repositories/repositories/{interfaces_repository.rb → interfaces.rb} +4 -4
- data/lib/vedeu/storage/associative_store.rb +2 -0
- data/lib/vedeu/storage/conveyor_store.rb +2 -0
- data/lib/vedeu/storage/fifo_store.rb +2 -0
- data/lib/vedeu/storage/store.rb +7 -7
- data/lib/vedeu/support/options.rb +2 -0
- data/lib/vedeu/support/terminal.rb +3 -3
- data/lib/vedeu/support/timer.rb +2 -0
- data/lib/vedeu/support/visibility.rb +2 -0
- data/lib/vedeu/templating/directive.rb +2 -0
- data/lib/vedeu/templating/preprocessor.rb +2 -0
- data/lib/vedeu/version.rb +1 -1
- data/lib/vedeu.rb +3 -1
- data/test/lib/vedeu/bindings_test.rb +15 -0
- data/test/lib/vedeu/buffers/buffer_test.rb +12 -0
- data/test/lib/vedeu/configuration/api_test.rb +0 -39
- data/test/lib/vedeu/configuration/configuration_test.rb +0 -9
- data/test/lib/vedeu/cursor/cursor_test.rb +6 -0
- data/test/lib/vedeu/dsl/border_test.rb +12 -0
- data/test/lib/vedeu/dsl/composition_test.rb +2 -2
- data/test/lib/vedeu/geometry/index_position_test.rb +2 -0
- data/test/lib/vedeu/geometry/position_test.rb +6 -0
- data/test/lib/vedeu/models/cell_test.rb +16 -8
- data/test/lib/vedeu/models/char_test.rb +8 -0
- data/test/lib/vedeu/models/composition_test.rb +2 -2
- data/test/lib/vedeu/models/interface_test.rb +10 -0
- data/test/lib/vedeu/models/line_test.rb +12 -0
- data/test/lib/vedeu/models/stream_test.rb +1 -13
- data/test/lib/vedeu/output/border_test.rb +1 -0
- data/test/lib/vedeu/output/presentation_test.rb +2 -0
- data/test/lib/vedeu/output/render_border_test.rb +16 -0
- data/test/lib/vedeu/output/renderers/file_test.rb +32 -16
- data/test/lib/vedeu/repositories/collection_test.rb +7 -0
- data/test/lib/vedeu/repositories/collections/all_test.rb +18 -6
- data/test/lib/vedeu/repositories/model_test.rb +33 -7
- data/test/lib/vedeu/repositories/repositories/{background_colours_test.rb → backgrounds_test.rb} +3 -3
- data/test/lib/vedeu/repositories/repositories/borders_test.rb +7 -17
- data/test/lib/vedeu/repositories/repositories/buffers_test.rb +7 -22
- data/test/lib/vedeu/repositories/repositories/cursors_test.rb +32 -0
- data/test/lib/vedeu/repositories/repositories/events_test.rb +22 -0
- data/test/lib/vedeu/repositories/repositories/{foreground_colours_test.rb → foregrounds_test.rb} +3 -3
- data/test/lib/vedeu/repositories/repositories/geometries_test.rb +7 -21
- data/test/lib/vedeu/repositories/repositories/groups_test.rb +11 -0
- data/test/lib/vedeu/repositories/repositories/{interfaces_repositories_test.rb → interfaces_test.rb} +14 -3
- data/test/lib/vedeu/repositories/repositories/keymaps_test.rb +10 -1
- data/test/lib/vedeu/repositories/repositories/menus_test.rb +10 -1
- data/test/lib/vedeu/repositories/repository_test.rb +15 -9
- data/test/lib/vedeu/storage/conveyor_store_test.rb +2 -4
- data/test/lib/vedeu/support/terminal_test.rb +2 -2
- data/test/lib/vedeu/templating/helpers_test.rb +4 -0
- data/vedeu.gemspec +0 -2
- metadata +20 -54
- data/config/cucumber.yml +0 -8
- data/features/cli_vedeu.feature +0 -5
- data/features/start_stop.feature +0 -27
- data/features/step_definitions/vedeu_steps.rb +0 -0
- data/features/support/env.rb +0 -15
- data/lib/vedeu/generator/templates/application/app/models/keymaps/_system_.rb +0 -7
- data/test/lib/vedeu/repositories/repositories/events_repository_test.rb +0 -13
- data/test/lib/vedeu/repositories/repositories/interfaces_repository_test.rb +0 -11
@@ -242,45 +242,6 @@ module Vedeu
|
|
242
242
|
# it { skip }
|
243
243
|
end
|
244
244
|
|
245
|
-
describe 'redefining system keys' do
|
246
|
-
methods_and_keys = {
|
247
|
-
exit_key: :exit,
|
248
|
-
focus_next_key: :focus_next,
|
249
|
-
focus_prev_key: :focus_prev,
|
250
|
-
mode_switch_key: :mode_switch,
|
251
|
-
}
|
252
|
-
|
253
|
-
context 'when using an invalid value' do
|
254
|
-
invalid_params = [nil, '', 123, 'oops']
|
255
|
-
|
256
|
-
methods_and_keys.each do |meth, _|
|
257
|
-
invalid_params.each do |param|
|
258
|
-
context 'when the parameter is invalid' do
|
259
|
-
it {
|
260
|
-
proc {
|
261
|
-
Vedeu.configure { send(meth, param) }
|
262
|
-
}.must_raise(InvalidSyntax)
|
263
|
-
}
|
264
|
-
end
|
265
|
-
end
|
266
|
-
end
|
267
|
-
end
|
268
|
-
|
269
|
-
context 'when using a valid value' do
|
270
|
-
valid_params = ['v', :f1]
|
271
|
-
|
272
|
-
methods_and_keys.each do |meth, key|
|
273
|
-
valid_params.each do |param|
|
274
|
-
it 'sets the system key to the desired value' do
|
275
|
-
configuration = Vedeu.configure { send(meth, param) }
|
276
|
-
|
277
|
-
configuration.system_keys[key].must_equal(param)
|
278
|
-
end
|
279
|
-
end
|
280
|
-
end
|
281
|
-
end
|
282
|
-
end
|
283
|
-
|
284
245
|
end # API
|
285
246
|
|
286
247
|
end # Config
|
@@ -9,15 +9,6 @@ module Vedeu
|
|
9
9
|
before { Configuration.reset! }
|
10
10
|
after { test_configuration }
|
11
11
|
|
12
|
-
describe '.default_system_keys' do
|
13
|
-
it 'returns the default system keys' do
|
14
|
-
Configuration.default_system_keys.must_equal(exit: 'q',
|
15
|
-
focus_next: :tab,
|
16
|
-
focus_prev: :shift_tab,
|
17
|
-
mode_switch: :escape,)
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
12
|
describe '#debug?' do
|
22
13
|
it { described.must_respond_to(:debug) }
|
23
14
|
|
@@ -58,6 +58,18 @@ module Vedeu
|
|
58
58
|
it { subject.must_equal('D') }
|
59
59
|
end
|
60
60
|
|
61
|
+
describe '#disable!' do
|
62
|
+
subject { instance.disable! }
|
63
|
+
|
64
|
+
it { subject.must_be_instance_of(FalseClass) }
|
65
|
+
end
|
66
|
+
|
67
|
+
describe '#enable!' do
|
68
|
+
subject { instance.enable! }
|
69
|
+
|
70
|
+
it { subject.must_be_instance_of(TrueClass) }
|
71
|
+
end
|
72
|
+
|
61
73
|
describe '#horizontal' do
|
62
74
|
let(:char) { 'H' }
|
63
75
|
|
@@ -24,7 +24,7 @@ module Vedeu
|
|
24
24
|
end
|
25
25
|
}
|
26
26
|
|
27
|
-
it { subject.must_be_instance_of(Vedeu::
|
27
|
+
it { subject.must_be_instance_of(Vedeu::InterfaceCollection) }
|
28
28
|
it { subject.first.must_be_instance_of(Vedeu::Interface) }
|
29
29
|
|
30
30
|
context 'when the block is not given' do
|
@@ -69,7 +69,7 @@ module Vedeu
|
|
69
69
|
with(object, filename).returns(content)
|
70
70
|
end
|
71
71
|
|
72
|
-
it { subject.must_be_instance_of(Vedeu::
|
72
|
+
it { subject.must_be_instance_of(Vedeu::InterfaceCollection) }
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
@@ -22,14 +22,20 @@ module Vedeu
|
|
22
22
|
let(:y) {}
|
23
23
|
|
24
24
|
describe '#initialize' do
|
25
|
-
|
26
|
-
|
27
|
-
it {
|
28
|
-
it {
|
29
|
-
it {
|
30
|
-
it {
|
31
|
-
|
32
|
-
|
25
|
+
it { instance.must_be_instance_of(described) }
|
26
|
+
it { instance.instance_variable_get('@colour').must_equal(colour) }
|
27
|
+
it { instance.instance_variable_get('@style').must_equal(style) }
|
28
|
+
it { instance.instance_variable_get('@value').must_equal(_value) }
|
29
|
+
it { instance.instance_variable_get('@x').must_equal(x) }
|
30
|
+
it { instance.instance_variable_get('@y').must_equal(y) }
|
31
|
+
end
|
32
|
+
|
33
|
+
describe 'accessors' do
|
34
|
+
it { instance.must_respond_to(:colour) }
|
35
|
+
it { instance.must_respond_to(:style) }
|
36
|
+
it { instance.must_respond_to(:value) }
|
37
|
+
it { instance.must_respond_to(:x) }
|
38
|
+
it { instance.must_respond_to(:y) }
|
33
39
|
end
|
34
40
|
|
35
41
|
describe '#eql?' do
|
@@ -37,6 +43,8 @@ module Vedeu
|
|
37
43
|
|
38
44
|
subject { instance.eql?(other) }
|
39
45
|
|
46
|
+
it { subject.must_respond_to(:==) }
|
47
|
+
|
40
48
|
it { subject.must_equal(true) }
|
41
49
|
|
42
50
|
context 'when different to other' do
|
@@ -39,13 +39,13 @@ module Vedeu
|
|
39
39
|
|
40
40
|
subject { instance.add(child) }
|
41
41
|
|
42
|
-
it { subject.must_be_instance_of(Vedeu::
|
42
|
+
it { subject.must_be_instance_of(Vedeu::InterfaceCollection) }
|
43
43
|
end
|
44
44
|
|
45
45
|
describe '#interfaces' do
|
46
46
|
subject { instance.interfaces }
|
47
47
|
|
48
|
-
it { subject.must_be_instance_of(Vedeu::
|
48
|
+
it { subject.must_be_instance_of(Vedeu::InterfaceCollection) }
|
49
49
|
end
|
50
50
|
|
51
51
|
describe '#parent' do
|
@@ -67,9 +67,19 @@ module Vedeu
|
|
67
67
|
it { instance.must_respond_to(:lines=) }
|
68
68
|
end
|
69
69
|
|
70
|
+
describe '#lines' do
|
71
|
+
subject { instance.lines }
|
72
|
+
|
73
|
+
it { instance.must_respond_to(:content) }
|
74
|
+
it { instance.must_respond_to(:value) }
|
75
|
+
end
|
76
|
+
|
70
77
|
describe '#lines?' do
|
71
78
|
subject { instance.lines? }
|
72
79
|
|
80
|
+
it { instance.must_respond_to(:content?) }
|
81
|
+
it { instance.must_respond_to(:value?) }
|
82
|
+
|
73
83
|
context 'when the interface has content' do
|
74
84
|
let(:lines) { [:line] }
|
75
85
|
|
@@ -50,6 +50,16 @@ module Vedeu
|
|
50
50
|
it { instance.instance_variable_get('@parent').must_equal(parent) }
|
51
51
|
end
|
52
52
|
|
53
|
+
describe 'accessors' do
|
54
|
+
it { instance.must_respond_to(:parent) }
|
55
|
+
it { instance.must_respond_to(:parent=) }
|
56
|
+
it { instance.must_respond_to(:attributes) }
|
57
|
+
end
|
58
|
+
|
59
|
+
describe '#add' do
|
60
|
+
subject { instance.add(child) }
|
61
|
+
end
|
62
|
+
|
53
63
|
describe '#chars' do
|
54
64
|
subject { instance.chars }
|
55
65
|
|
@@ -107,6 +117,8 @@ module Vedeu
|
|
107
117
|
describe '#streams' do
|
108
118
|
subject { instance.streams }
|
109
119
|
|
120
|
+
it { instance.must_respond_to(:value) }
|
121
|
+
|
110
122
|
it { subject.must_be_instance_of(Vedeu::Streams) }
|
111
123
|
end
|
112
124
|
|
@@ -36,26 +36,14 @@ module Vedeu
|
|
36
36
|
it { instance.instance_variable_get('@parent').must_equal(parent) }
|
37
37
|
end
|
38
38
|
|
39
|
-
describe '
|
39
|
+
describe 'accessors' do
|
40
40
|
it { instance.must_respond_to(:parent) }
|
41
|
-
end
|
42
|
-
|
43
|
-
describe '#parent=' do
|
44
41
|
it { instance.must_respond_to(:parent=) }
|
45
|
-
end
|
46
|
-
|
47
|
-
describe '#value' do
|
48
42
|
it { instance.must_respond_to(:value) }
|
49
43
|
it { instance.must_respond_to(:content) }
|
50
44
|
it { instance.must_respond_to(:data) }
|
51
45
|
it { instance.must_respond_to(:text) }
|
52
|
-
end
|
53
|
-
|
54
|
-
describe '#value=' do
|
55
46
|
it { instance.must_respond_to(:value=) }
|
56
|
-
end
|
57
|
-
|
58
|
-
describe '#attributes' do
|
59
47
|
it { instance.must_respond_to(:attributes) }
|
60
48
|
end
|
61
49
|
|
@@ -108,6 +108,7 @@ module Vedeu
|
|
108
108
|
it { instance.must_respond_to(:vertical=) }
|
109
109
|
it { instance.must_respond_to(:name) }
|
110
110
|
it { instance.must_respond_to(:enabled) }
|
111
|
+
it { instance.must_respond_to(:enabled=) }
|
111
112
|
it { instance.must_respond_to(:enabled?) }
|
112
113
|
end
|
113
114
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Vedeu
|
4
|
+
|
5
|
+
describe RenderBorder do
|
6
|
+
|
7
|
+
let(:described) { Vedeu::RenderBorder }
|
8
|
+
let(:instance) { described.new(border) }
|
9
|
+
let(:border) {
|
10
|
+
Vedeu.border 'Vedeu::RenderBorder' do
|
11
|
+
end
|
12
|
+
}
|
13
|
+
|
14
|
+
end # RenderBorder
|
15
|
+
|
16
|
+
end # Vedeu
|
@@ -8,13 +8,15 @@ module Vedeu
|
|
8
8
|
|
9
9
|
let(:described) { Vedeu::Renderers::File }
|
10
10
|
let(:instance) { described.new(output, options) }
|
11
|
-
let(:output) {}
|
11
|
+
let(:output) { 'Some content...' }
|
12
12
|
let(:options) {
|
13
13
|
{
|
14
|
-
|
14
|
+
filename: filename,
|
15
|
+
timestamp: timestamp,
|
15
16
|
}
|
16
17
|
}
|
17
|
-
let(:
|
18
|
+
let(:filename) { 'out' }
|
19
|
+
let(:timestamp) { false }
|
18
20
|
|
19
21
|
describe '#initialize' do
|
20
22
|
it { instance.must_be_instance_of(described) }
|
@@ -27,26 +29,40 @@ module Vedeu
|
|
27
29
|
end
|
28
30
|
|
29
31
|
describe '#render' do
|
30
|
-
let(:_time) { Time.new(2015, 4, 12, 20, 05) }
|
31
|
-
|
32
|
-
before { File.stubs(:open) }
|
32
|
+
let(:_time) { Time.new(2015, 4, 12, 20, 05, 00, "+01:00") }
|
33
33
|
|
34
34
|
subject { instance.render }
|
35
35
|
|
36
|
-
|
36
|
+
it { subject.must_be_instance_of(String) }
|
37
|
+
|
38
|
+
context 'when the filename option is not set' do
|
39
|
+
context 'when the timestamp option is not set' do
|
40
|
+
it {
|
41
|
+
::File.expects(:open).with('/tmp/out', 'w')
|
42
|
+
subject
|
43
|
+
}
|
44
|
+
end
|
45
|
+
|
46
|
+
context 'when the timestamp option is set' do
|
47
|
+
let(:timestamp) { true }
|
37
48
|
|
38
|
-
|
39
|
-
# context 'when the timestamp option is true' do
|
40
|
-
# before { Time.stubs(:now).returns(_time) }
|
49
|
+
before { Time.stubs(:now).returns(_time) }
|
41
50
|
|
42
|
-
|
43
|
-
|
51
|
+
it {
|
52
|
+
::File.expects(:open).with('/tmp/out_1428865500.0', 'w')
|
53
|
+
subject
|
54
|
+
}
|
55
|
+
end
|
56
|
+
end
|
44
57
|
|
45
|
-
|
46
|
-
|
58
|
+
context 'when the filename option is set' do
|
59
|
+
let(:filename) { 'some_name' }
|
47
60
|
|
48
|
-
|
49
|
-
|
61
|
+
it {
|
62
|
+
::File.expects(:open).with('/tmp/some_name', 'w')
|
63
|
+
subject
|
64
|
+
}
|
65
|
+
end
|
50
66
|
end
|
51
67
|
|
52
68
|
end # File
|
@@ -26,6 +26,12 @@ module Vedeu
|
|
26
26
|
it { instance.must_respond_to(:name=) }
|
27
27
|
end
|
28
28
|
|
29
|
+
describe '.coerce' do
|
30
|
+
subject { described.coerce(collection, parent, model_name) }
|
31
|
+
|
32
|
+
# it { skip }
|
33
|
+
end
|
34
|
+
|
29
35
|
describe '#[]' do
|
30
36
|
let(:collection) { [:hydrogen, :helium, :lithium, :beryllium] }
|
31
37
|
let(:_value) { 1..2 }
|
@@ -39,6 +45,7 @@ module Vedeu
|
|
39
45
|
describe '#add' do
|
40
46
|
subject { instance.add(:hydrogen) }
|
41
47
|
|
48
|
+
it { instance.must_respond_to(:<<) }
|
42
49
|
it { subject.must_be_instance_of(Collection) }
|
43
50
|
it { subject.all.must_equal([:hydrogen]) }
|
44
51
|
|
@@ -7,39 +7,47 @@ module Vedeu
|
|
7
7
|
let(:described) { Vedeu::Chars }
|
8
8
|
let(:instance) { described.new }
|
9
9
|
|
10
|
+
it { described.superclass.must_equal(Vedeu::Collection) }
|
11
|
+
|
10
12
|
describe '#initialize' do
|
11
13
|
it { instance.must_be_instance_of(described) }
|
12
14
|
end
|
13
15
|
|
14
16
|
end # Chars
|
15
17
|
|
16
|
-
describe
|
18
|
+
describe EventCollection do
|
17
19
|
|
18
|
-
let(:described) { Vedeu::
|
20
|
+
let(:described) { Vedeu::EventCollection }
|
19
21
|
let(:instance) { described.new }
|
20
22
|
|
23
|
+
it { described.superclass.must_equal(Vedeu::Collection) }
|
24
|
+
|
21
25
|
describe '#initialize' do
|
22
26
|
it { instance.must_be_instance_of(described) }
|
23
27
|
end
|
24
28
|
|
25
|
-
end #
|
29
|
+
end # EventCollection
|
26
30
|
|
27
|
-
describe
|
31
|
+
describe InterfaceCollection do
|
28
32
|
|
29
|
-
let(:described) { Vedeu::
|
33
|
+
let(:described) { Vedeu::InterfaceCollection }
|
30
34
|
let(:instance) { described.new }
|
31
35
|
|
36
|
+
it { described.superclass.must_equal(Vedeu::Collection) }
|
37
|
+
|
32
38
|
describe '#initialize' do
|
33
39
|
it { instance.must_be_instance_of(described) }
|
34
40
|
end
|
35
41
|
|
36
|
-
end #
|
42
|
+
end # InterfaceCollection
|
37
43
|
|
38
44
|
describe Keys do
|
39
45
|
|
40
46
|
let(:described) { Vedeu::Keys }
|
41
47
|
let(:instance) { described.new }
|
42
48
|
|
49
|
+
it { described.superclass.must_equal(Vedeu::Collection) }
|
50
|
+
|
43
51
|
describe '#initialize' do
|
44
52
|
it { instance.must_be_instance_of(described) }
|
45
53
|
end
|
@@ -51,6 +59,8 @@ module Vedeu
|
|
51
59
|
let(:described) { Vedeu::Lines }
|
52
60
|
let(:instance) { described.new }
|
53
61
|
|
62
|
+
it { described.superclass.must_equal(Vedeu::Collection) }
|
63
|
+
|
54
64
|
describe '#initialize' do
|
55
65
|
it { instance.must_be_instance_of(described) }
|
56
66
|
end
|
@@ -62,6 +72,8 @@ module Vedeu
|
|
62
72
|
let(:described) { Vedeu::Streams }
|
63
73
|
let(:instance) { described.new }
|
64
74
|
|
75
|
+
it { described.superclass.must_equal(Vedeu::Collection) }
|
76
|
+
|
65
77
|
describe '#initialize' do
|
66
78
|
it { instance.must_be_instance_of(described) }
|
67
79
|
end
|
@@ -22,23 +22,49 @@ module Vedeu
|
|
22
22
|
end # DSL
|
23
23
|
|
24
24
|
describe Model do
|
25
|
-
|
25
|
+
|
26
|
+
let(:described) { ModelTestClass }
|
27
|
+
let(:instance) { described.new(attributes) }
|
26
28
|
let(:attributes) {
|
27
29
|
{
|
28
30
|
name: 'hydrogen'
|
29
31
|
}
|
30
32
|
}
|
31
33
|
|
32
|
-
describe '
|
33
|
-
it {
|
34
|
+
describe 'accessors' do
|
35
|
+
it { instance.must_respond_to(:repository) }
|
36
|
+
it { instance.must_respond_to(:repository=) }
|
37
|
+
end
|
38
|
+
|
39
|
+
describe '.build' do
|
40
|
+
let(:attributes) {}
|
41
|
+
|
42
|
+
subject { described.build(attributes) { } }
|
43
|
+
|
44
|
+
# it { skip }
|
45
|
+
end
|
46
|
+
|
47
|
+
describe '.child' do
|
48
|
+
let(:klass) {}
|
49
|
+
|
50
|
+
subject { described.child(klass) }
|
51
|
+
|
52
|
+
it { described.must_respond_to(:member) }
|
53
|
+
it { described.must_respond_to(:collection) }
|
54
|
+
|
55
|
+
# it { skip }
|
34
56
|
end
|
35
57
|
|
36
|
-
describe '
|
37
|
-
|
58
|
+
describe '.repository' do
|
59
|
+
let(:klass) {}
|
60
|
+
|
61
|
+
subject { described.repository(klass) }
|
62
|
+
|
63
|
+
# it { skip }
|
38
64
|
end
|
39
65
|
|
40
66
|
describe '#deputy' do
|
41
|
-
subject {
|
67
|
+
subject { instance.deputy }
|
42
68
|
|
43
69
|
it 'returns the DSL instance' do
|
44
70
|
subject.must_be_instance_of(DSL::ModelTestClass)
|
@@ -46,7 +72,7 @@ module Vedeu
|
|
46
72
|
end
|
47
73
|
|
48
74
|
describe '#store' do
|
49
|
-
subject {
|
75
|
+
subject { instance.store }
|
50
76
|
|
51
77
|
it 'returns the model' do
|
52
78
|
subject.must_be_instance_of(ModelTestClass)
|
data/test/lib/vedeu/repositories/repositories/{background_colours_test.rb → backgrounds_test.rb}
RENAMED
@@ -2,9 +2,9 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
module Vedeu
|
4
4
|
|
5
|
-
describe
|
5
|
+
describe Backgrounds do
|
6
6
|
|
7
|
-
let(:described) { Vedeu::
|
7
|
+
let(:described) { Vedeu::Backgrounds }
|
8
8
|
|
9
9
|
describe '.background_colours' do
|
10
10
|
subject { described.background_colours }
|
@@ -12,6 +12,6 @@ module Vedeu
|
|
12
12
|
it { subject.must_be_instance_of(described) }
|
13
13
|
end
|
14
14
|
|
15
|
-
end #
|
15
|
+
end # Backgrounds
|
16
16
|
|
17
17
|
end # Vedeu
|
@@ -8,25 +8,15 @@ module Vedeu
|
|
8
8
|
|
9
9
|
after { Vedeu.borders.reset }
|
10
10
|
|
11
|
-
|
12
|
-
let(:_name) { 'carbon' }
|
11
|
+
it { described.must_respond_to(:borders) }
|
13
12
|
|
14
|
-
|
13
|
+
describe '.reset!' do
|
14
|
+
subject { described.reset! }
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
end
|
21
|
-
|
22
|
-
it { subject.must_be_instance_of(Vedeu::Border) }
|
23
|
-
end
|
24
|
-
|
25
|
-
context 'when the border does not exist' do
|
26
|
-
let(:_name) { 'nitrogen' }
|
27
|
-
|
28
|
-
it { subject.must_be_instance_of(Vedeu::Null::Border) }
|
29
|
-
end
|
16
|
+
it {
|
17
|
+
described.expects(:register).with(Vedeu::Border)
|
18
|
+
subject
|
19
|
+
}
|
30
20
|
end
|
31
21
|
|
32
22
|
end # Borders
|
@@ -7,30 +7,15 @@ module Vedeu
|
|
7
7
|
let(:described) { Vedeu::Buffers }
|
8
8
|
let(:instance) { described.buffers }
|
9
9
|
|
10
|
-
|
11
|
-
Vedeu.buffers.reset
|
12
|
-
Vedeu.interfaces.reset
|
13
|
-
end
|
14
|
-
|
15
|
-
describe '#by_name' do
|
16
|
-
let(:_name) { 'carbon' }
|
17
|
-
|
18
|
-
subject { described.buffers.by_name(_name) }
|
19
|
-
|
20
|
-
context 'when the buffer exists' do
|
21
|
-
before do
|
22
|
-
Vedeu.interface 'carbon' do
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
it { subject.must_be_instance_of(Vedeu::Buffer) }
|
27
|
-
end
|
10
|
+
it { described.must_respond_to(:buffers) }
|
28
11
|
|
29
|
-
|
30
|
-
|
12
|
+
describe '#reset!' do
|
13
|
+
subject { described.reset! }
|
31
14
|
|
32
|
-
|
33
|
-
|
15
|
+
it {
|
16
|
+
described.expects(:register).with(Vedeu::Buffer)
|
17
|
+
subject
|
18
|
+
}
|
34
19
|
end
|
35
20
|
|
36
21
|
end # Buffers
|