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
@@ -8,8 +8,9 @@ module Vedeu
|
|
8
8
|
|
9
9
|
describe Colour do
|
10
10
|
|
11
|
-
let(:described)
|
12
|
-
let(:
|
11
|
+
let(:described) { Vedeu::Presentation::Colour }
|
12
|
+
let(:included_described) { Vedeu::PresentationColourTestClass }
|
13
|
+
let(:included_instance) { included_described.new(attributes) }
|
13
14
|
let(:attributes) {
|
14
15
|
{
|
15
16
|
colour: colour,
|
@@ -27,7 +28,7 @@ module Vedeu
|
|
27
28
|
let(:parent) { Vedeu::ParentPresentationColourTestClass.new }
|
28
29
|
|
29
30
|
describe '#background' do
|
30
|
-
subject {
|
31
|
+
subject { included_instance.background }
|
31
32
|
|
32
33
|
it { subject.must_be_instance_of(Vedeu::Colours::Background) }
|
33
34
|
|
@@ -53,19 +54,19 @@ module Vedeu
|
|
53
54
|
end
|
54
55
|
|
55
56
|
describe '#background=' do
|
56
|
-
subject {
|
57
|
+
subject { included_instance.background = '#987654' }
|
57
58
|
|
58
59
|
it do
|
59
|
-
|
60
|
+
included_instance.colour.background.colour.must_equal('#000033')
|
60
61
|
subject
|
61
|
-
|
62
|
+
included_instance.colour.background.colour.must_equal('#987654')
|
62
63
|
end
|
63
64
|
|
64
65
|
it { subject.must_equal('#987654') }
|
65
66
|
end
|
66
67
|
|
67
68
|
describe '#colour' do
|
68
|
-
subject {
|
69
|
+
subject { included_instance.colour }
|
69
70
|
|
70
71
|
it { subject.must_be_instance_of(Vedeu::Colours::Colour) }
|
71
72
|
|
@@ -96,13 +97,13 @@ module Vedeu
|
|
96
97
|
Vedeu::Colours::Colour.new(foreground: '#00ff00', background: '#000000')
|
97
98
|
}
|
98
99
|
|
99
|
-
subject {
|
100
|
+
subject { included_instance.colour=(colour) }
|
100
101
|
|
101
102
|
it { subject.must_be_instance_of(Vedeu::Colours::Colour) }
|
102
103
|
end
|
103
104
|
|
104
105
|
describe '#foreground' do
|
105
|
-
subject {
|
106
|
+
subject { included_instance.foreground }
|
106
107
|
|
107
108
|
it { subject.must_be_instance_of(Vedeu::Colours::Foreground) }
|
108
109
|
it { subject.colour.must_equal('#aadd00') }
|
@@ -129,12 +130,12 @@ module Vedeu
|
|
129
130
|
end
|
130
131
|
|
131
132
|
describe '#foreground=' do
|
132
|
-
subject {
|
133
|
+
subject { included_instance.foreground = '#123456' }
|
133
134
|
|
134
135
|
it do
|
135
|
-
|
136
|
+
included_instance.colour.foreground.colour.must_equal('#aadd00')
|
136
137
|
subject
|
137
|
-
|
138
|
+
included_instance.colour.foreground.colour.must_equal('#123456')
|
138
139
|
end
|
139
140
|
|
140
141
|
it { subject.must_equal('#123456') }
|
@@ -36,7 +36,9 @@ module Vedeu
|
|
36
36
|
|
37
37
|
describe Presentation do
|
38
38
|
|
39
|
-
let(:
|
39
|
+
let(:described) { Vedeu::Presentation }
|
40
|
+
let(:included_described) { Vedeu::PresentationTestClass }
|
41
|
+
let(:included_instance) { included_described.new(attributes) }
|
40
42
|
let(:attributes) {
|
41
43
|
{
|
42
44
|
colour: { background: background, foreground: foreground },
|
@@ -80,7 +82,7 @@ module Vedeu
|
|
80
82
|
"\e[38;2;255;0;0m\e[48;2;0;0;0m\e[4mt"
|
81
83
|
}
|
82
84
|
|
83
|
-
it {
|
85
|
+
it { included_instance.must_respond_to(:to_str) }
|
84
86
|
|
85
87
|
it 'returns output' do
|
86
88
|
stream.to_s.must_equal(expected)
|
@@ -34,7 +34,9 @@ module Vedeu
|
|
34
34
|
|
35
35
|
describe Styles do
|
36
36
|
|
37
|
-
let(:
|
37
|
+
let(:described) { Vedeu::Presentation::Styles }
|
38
|
+
let(:included_described) { Vedeu::PresentationStyleTestClass }
|
39
|
+
let(:included_instance) { included_described.new(attributes) }
|
38
40
|
let(:attributes) {
|
39
41
|
{
|
40
42
|
parent: parent,
|
@@ -45,7 +47,7 @@ module Vedeu
|
|
45
47
|
let(:style) { ['bold'] }
|
46
48
|
|
47
49
|
describe '#style' do
|
48
|
-
subject {
|
50
|
+
subject { included_instance.style }
|
49
51
|
|
50
52
|
it { subject.must_be_instance_of(Vedeu::Presentation::Style) }
|
51
53
|
|
@@ -71,7 +73,7 @@ module Vedeu
|
|
71
73
|
describe '#style=' do
|
72
74
|
let(:style) { Vedeu::Presentation::Style.new('normal') }
|
73
75
|
|
74
|
-
subject {
|
76
|
+
subject { included_instance.style = (style) }
|
75
77
|
|
76
78
|
it { subject.must_be_instance_of(Vedeu::Presentation::Style) }
|
77
79
|
end
|
@@ -15,10 +15,8 @@ module Vedeu
|
|
15
15
|
describe Options do
|
16
16
|
|
17
17
|
let(:described) { Vedeu::Renderers::Options }
|
18
|
-
let(:
|
19
|
-
|
20
|
-
let(:including_described) { Vedeu::Renderers::RenderersTestClass }
|
21
|
-
let(:including_instance) { including_described.new(options) }
|
18
|
+
let(:included_described) { Vedeu::Renderers::RenderersTestClass }
|
19
|
+
let(:included_instance) { included_described.new(options) }
|
22
20
|
let(:options) {
|
23
21
|
{
|
24
22
|
compression: compression,
|
@@ -47,38 +45,38 @@ module Vedeu
|
|
47
45
|
let(:write_file) { false }
|
48
46
|
|
49
47
|
describe '#initialize' do
|
50
|
-
it {
|
51
|
-
it {
|
48
|
+
it { included_instance.must_be_instance_of(included_described) }
|
49
|
+
it { included_instance.instance_variable_get('@options').must_equal(options) }
|
52
50
|
end
|
53
51
|
|
54
52
|
describe '#clear' do
|
55
|
-
subject {
|
53
|
+
subject { included_instance.clear }
|
56
54
|
|
57
55
|
it { proc { subject }.must_raise(Vedeu::Error::NotImplemented) }
|
58
56
|
end
|
59
57
|
|
60
58
|
describe '#options' do
|
61
|
-
it {
|
59
|
+
it { included_instance.must_respond_to(:options) }
|
62
60
|
end
|
63
61
|
|
64
62
|
describe '#options=' do
|
65
|
-
it {
|
63
|
+
it { included_instance.must_respond_to(:options=) }
|
66
64
|
end
|
67
65
|
|
68
66
|
describe '#render' do
|
69
|
-
subject {
|
67
|
+
subject { included_instance.render }
|
70
68
|
|
71
69
|
it { proc { subject }.must_raise(Vedeu::Error::NotImplemented) }
|
72
70
|
end
|
73
71
|
|
74
72
|
describe '#write' do
|
75
|
-
subject {
|
73
|
+
subject { included_instance.write }
|
76
74
|
|
77
75
|
it { proc { subject }.must_raise(Vedeu::Error::NotImplemented) }
|
78
76
|
end
|
79
77
|
|
80
78
|
# describe '#compression?' do
|
81
|
-
# subject {
|
79
|
+
# subject { included_instance.compression? }
|
82
80
|
|
83
81
|
# context 'when the option is not set or is set to false' do
|
84
82
|
# before { options.tap { |o| o.delete(:compression) } }
|
@@ -21,13 +21,14 @@ module Vedeu
|
|
21
21
|
describe Assemblage do
|
22
22
|
|
23
23
|
let(:described) { Vedeu::Repositories::Assemblage }
|
24
|
-
let(:
|
24
|
+
let(:included_described) { Vedeu::Repositories::CollectionTestClass }
|
25
|
+
let(:included_instance) { included_described.new(collection) }
|
25
26
|
let(:collection) { 'Some text...'.chars }
|
26
27
|
|
27
28
|
describe '#[]' do
|
28
29
|
let(:collection) { [:hydrogen, :helium, :lithium, :beryllium] }
|
29
30
|
|
30
|
-
subject {
|
31
|
+
subject { included_instance[index] }
|
31
32
|
|
32
33
|
context 'when the index is a range' do
|
33
34
|
let(:index) { 1..2 }
|
@@ -45,7 +46,7 @@ module Vedeu
|
|
45
46
|
end
|
46
47
|
|
47
48
|
describe '#any?' do
|
48
|
-
subject {
|
49
|
+
subject { included_instance.any? }
|
49
50
|
|
50
51
|
context 'when the collection is empty' do
|
51
52
|
let(:collection) { [] }
|
@@ -59,7 +60,7 @@ module Vedeu
|
|
59
60
|
end
|
60
61
|
|
61
62
|
describe '#empty?' do
|
62
|
-
subject {
|
63
|
+
subject { included_instance.empty? }
|
63
64
|
|
64
65
|
context 'when the collection is empty' do
|
65
66
|
let(:collection) { [] }
|
@@ -73,18 +74,18 @@ module Vedeu
|
|
73
74
|
end
|
74
75
|
|
75
76
|
describe '#eql?' do
|
76
|
-
let(:other) {
|
77
|
+
let(:other) { included_instance }
|
77
78
|
|
78
|
-
subject {
|
79
|
+
subject { included_instance.eql?(other) }
|
79
80
|
|
80
81
|
it { subject.must_equal(true) }
|
81
82
|
|
82
83
|
context 'when different to other' do
|
83
84
|
let(:some_collection) {
|
84
|
-
|
85
|
+
included_described.new('Some text...'.chars)
|
85
86
|
}
|
86
87
|
let(:other_collection) {
|
87
|
-
|
88
|
+
included_described.new('Other text...'.chars)
|
88
89
|
}
|
89
90
|
|
90
91
|
it { (some_collection == other_collection).must_equal(false) }
|
@@ -92,11 +93,11 @@ module Vedeu
|
|
92
93
|
end
|
93
94
|
|
94
95
|
describe '#==' do
|
95
|
-
it {
|
96
|
+
it { included_instance.must_respond_to(:==) }
|
96
97
|
end
|
97
98
|
|
98
99
|
describe '#size' do
|
99
|
-
subject {
|
100
|
+
subject { included_instance.size }
|
100
101
|
|
101
102
|
context 'when the collection is empty' do
|
102
103
|
let(:collection) { [] }
|
@@ -22,9 +22,9 @@ module Vedeu
|
|
22
22
|
|
23
23
|
describe Defaults do
|
24
24
|
|
25
|
-
let(:described)
|
26
|
-
let(:
|
27
|
-
let(:
|
25
|
+
let(:described) { Vedeu::Repositories::Defaults }
|
26
|
+
let(:included_described) { Vedeu::Repositories::DefaultsTestClass }
|
27
|
+
let(:included_instance) { included_described.new(attributes) }
|
28
28
|
let(:attributes) {
|
29
29
|
{
|
30
30
|
invalid_attribute: :invalid_value
|
@@ -32,20 +32,22 @@ module Vedeu
|
|
32
32
|
}
|
33
33
|
|
34
34
|
describe '#initialize' do
|
35
|
-
it {
|
35
|
+
it { included_instance.must_be_instance_of(included_described) }
|
36
36
|
it do
|
37
|
-
|
37
|
+
included_instance.instance_variable_get('@some_attribute').
|
38
38
|
must_equal(:some_value)
|
39
39
|
end
|
40
40
|
it do
|
41
|
-
|
41
|
+
included_instance.instance_variables.
|
42
42
|
must_equal([:@some_attribute])
|
43
43
|
end
|
44
44
|
|
45
45
|
context 'when the attributes is not a Hash' do
|
46
46
|
let(:attributes) { :invalid }
|
47
47
|
|
48
|
-
it
|
48
|
+
it do
|
49
|
+
proc { included_instance }.must_raise(Vedeu::Error::InvalidSyntax)
|
50
|
+
end
|
49
51
|
end
|
50
52
|
end
|
51
53
|
|
@@ -8,8 +8,9 @@ module Vedeu
|
|
8
8
|
|
9
9
|
describe Model do
|
10
10
|
|
11
|
-
let(:described)
|
12
|
-
let(:
|
11
|
+
let(:described) { Vedeu::Repositories::Model }
|
12
|
+
let(:included_described) { Vedeu::Repositories::ModelTestClass }
|
13
|
+
let(:included_instance) { included_described.new(attributes) }
|
13
14
|
let(:attributes) {
|
14
15
|
{
|
15
16
|
name: 'hydrogen'
|
@@ -17,17 +18,17 @@ module Vedeu
|
|
17
18
|
}
|
18
19
|
|
19
20
|
describe '#repository' do
|
20
|
-
it {
|
21
|
+
it { included_instance.must_respond_to(:repository) }
|
21
22
|
end
|
22
23
|
|
23
24
|
describe '#repository=' do
|
24
|
-
it {
|
25
|
+
it { included_instance.must_respond_to(:repository=) }
|
25
26
|
end
|
26
27
|
|
27
28
|
describe '.build' do
|
28
29
|
let(:attributes) {}
|
29
30
|
|
30
|
-
subject {
|
31
|
+
subject { included_described.build(attributes) { } }
|
31
32
|
|
32
33
|
# @todo Add more tests.
|
33
34
|
# it { skip }
|
@@ -36,7 +37,7 @@ module Vedeu
|
|
36
37
|
describe '.repository' do
|
37
38
|
let(:klass) {}
|
38
39
|
|
39
|
-
subject {
|
40
|
+
subject { included_described.repository(klass) }
|
40
41
|
|
41
42
|
# @todo Add more tests.
|
42
43
|
# it { skip }
|
@@ -46,11 +47,11 @@ module Vedeu
|
|
46
47
|
let(:klass) {}
|
47
48
|
|
48
49
|
context 'when a block is given' do
|
49
|
-
subject {
|
50
|
+
subject { included_described.store(klass) }
|
50
51
|
end
|
51
52
|
|
52
53
|
context 'when a block is not given' do
|
53
|
-
subject {
|
54
|
+
subject { included_described.store(klass) { :some_proc } }
|
54
55
|
end
|
55
56
|
|
56
57
|
# @todo Add more tests.
|
@@ -58,7 +59,7 @@ module Vedeu
|
|
58
59
|
end
|
59
60
|
|
60
61
|
describe '#store' do
|
61
|
-
subject {
|
62
|
+
subject { included_instance.store }
|
62
63
|
|
63
64
|
it 'returns the model' do
|
64
65
|
subject.must_be_instance_of(Vedeu::Repositories::ModelTestClass)
|
@@ -6,26 +6,27 @@ module Vedeu
|
|
6
6
|
|
7
7
|
module Repositories
|
8
8
|
|
9
|
-
|
9
|
+
class RegisterableTestClass
|
10
10
|
|
11
|
-
|
11
|
+
include Vedeu::Repositories::Registerable
|
12
12
|
|
13
|
-
|
13
|
+
null Vedeu::Repositories::ModelTestClass
|
14
|
+
real Vedeu::Repositories::ModelTestClass
|
14
15
|
|
15
|
-
|
16
|
-
real Vedeu::Repositories::ModelTestClass
|
16
|
+
end
|
17
17
|
|
18
|
-
|
18
|
+
describe Registerable do
|
19
19
|
|
20
|
-
let(:described)
|
20
|
+
let(:described) { Vedeu::Repositories::Registerable }
|
21
|
+
let(:included_described) { Vedeu::Repositories::RegisterableTestClass }
|
21
22
|
|
22
|
-
it {
|
23
|
-
it {
|
23
|
+
it { included_described.must_respond_to(:repository) }
|
24
|
+
it { included_described.must_respond_to(:register) }
|
24
25
|
|
25
26
|
describe '.null' do
|
26
|
-
subject {
|
27
|
+
subject { included_described.new }
|
27
28
|
|
28
|
-
it {
|
29
|
+
it { included_described.must_respond_to(:null) }
|
29
30
|
|
30
31
|
it { subject.must_respond_to(:null_model) }
|
31
32
|
it { subject.must_respond_to(:null_attributes) }
|
@@ -34,24 +35,24 @@ module Vedeu
|
|
34
35
|
end
|
35
36
|
|
36
37
|
describe '.real' do
|
37
|
-
subject {
|
38
|
+
subject { included_described.new }
|
38
39
|
|
39
|
-
it {
|
40
|
+
it { included_described.must_respond_to(:real) }
|
40
41
|
|
41
42
|
it { subject.must_respond_to(:model) }
|
42
43
|
it { subject.model.must_equal(Vedeu::Repositories::ModelTestClass) }
|
43
44
|
end
|
44
45
|
|
45
46
|
describe '.reset' do
|
46
|
-
subject {
|
47
|
+
subject { included_described.reset! }
|
47
48
|
|
48
|
-
before {
|
49
|
+
before { included_described.stubs(:register) }
|
49
50
|
|
50
|
-
it {
|
51
|
-
it {
|
51
|
+
it { included_described.must_respond_to(:reset!) }
|
52
|
+
it { included_described.must_respond_to(:reset) }
|
52
53
|
|
53
54
|
it do
|
54
|
-
|
55
|
+
included_described.expects(:register)
|
55
56
|
subject
|
56
57
|
end
|
57
58
|
end
|