vedeu 0.4.61 → 0.4.62

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/lib/vedeu/all.rb +2 -0
  3. data/lib/vedeu/application/controller.rb +41 -9
  4. data/lib/vedeu/bindings.rb +4 -1
  5. data/lib/vedeu/bindings/application.rb +36 -0
  6. data/lib/vedeu/bootstrap.rb +6 -1
  7. data/lib/vedeu/cli/generator/templates/application/app/controllers/name.erb +10 -4
  8. data/lib/vedeu/colours/colour.rb +6 -9
  9. data/lib/vedeu/repositories/model.rb +1 -1
  10. data/lib/vedeu/router.rb +117 -0
  11. data/lib/vedeu/version.rb +1 -1
  12. data/test/lib/vedeu/application/application_controller_test.rb +1 -1
  13. data/test/lib/vedeu/application/application_helper_test.rb +1 -1
  14. data/test/lib/vedeu/application/controller_test.rb +35 -11
  15. data/test/lib/vedeu/application/helper_test.rb +1 -1
  16. data/test/lib/vedeu/bindings/application_test.rb +38 -0
  17. data/test/lib/vedeu/bindings_test.rb +45 -0
  18. data/test/lib/vedeu/borders/render_border_test.rb +1 -1
  19. data/test/lib/vedeu/buffers/buffer_test.rb +1 -1
  20. data/test/lib/vedeu/buffers/display_buffer_test.rb +2 -2
  21. data/test/lib/vedeu/cli/generator/application_test.rb +1 -1
  22. data/test/lib/vedeu/cli/generator/helpers_test.rb +1 -1
  23. data/test/lib/vedeu/colours/colour_test.rb +9 -1
  24. data/test/lib/vedeu/configuration/api_test.rb +3 -3
  25. data/test/lib/vedeu/cursor/move_test.rb +5 -5
  26. data/test/lib/vedeu/cursor/refresh_cursor_test.rb +4 -0
  27. data/test/lib/vedeu/distributed/client_test.rb +4 -4
  28. data/test/lib/vedeu/distributed/server_test.rb +9 -9
  29. data/test/lib/vedeu/dsl/use_test.rb +4 -4
  30. data/test/lib/vedeu/launcher_test.rb +2 -2
  31. data/test/lib/vedeu/main_loop_test.rb +2 -2
  32. data/test/lib/vedeu/output/refresh_group_test.rb +1 -1
  33. data/test/lib/vedeu/output/refresh_test.rb +1 -1
  34. data/test/lib/vedeu/output/renderers/html_test.rb +1 -1
  35. data/test/lib/vedeu/output/renderers/renderer_options_test.rb +1 -1
  36. data/test/lib/vedeu/output/renderers_test.rb +2 -2
  37. data/test/lib/vedeu/output/text_test.rb +2 -2
  38. data/test/lib/vedeu/plugins/plugin_test.rb +1 -1
  39. data/test/lib/vedeu/plugins_test.rb +2 -2
  40. data/test/lib/vedeu/repositories/collection_test.rb +1 -1
  41. data/test/lib/vedeu/repositories/model_test.rb +18 -3
  42. data/test/lib/vedeu/{repositories/all_test.rb → repositories_test.rb} +0 -0
  43. data/test/lib/vedeu/router_test.rb +192 -0
  44. data/test/lib/vedeu/traps_test.rb +1 -1
  45. data/test/lib/vedeu_test.rb +1 -1
  46. data/test/support/coverage.rb +42 -0
  47. data/vedeu.gemspec +2 -2
  48. metadata +14 -4
@@ -13,7 +13,7 @@ module Vedeu
13
13
  let(:described) { Vedeu::HelperTestClass }
14
14
  let(:instance) { described.new }
15
15
 
16
- # @todo
16
+ # @todo Add more tests.
17
17
 
18
18
  end # Helper
19
19
 
@@ -0,0 +1,38 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ module Bindings
6
+
7
+ describe Application do
8
+
9
+ context 'the application specific events are defined' do
10
+ it { Vedeu.bound?(:_action_).must_equal(true) }
11
+ end
12
+
13
+ describe '.action!' do
14
+ let(:controller) { :some_controller }
15
+ let(:action) { :show_basket }
16
+ let(:args) {
17
+ {
18
+ customer_id: 3,
19
+ product_id: 16,
20
+ }
21
+ }
22
+
23
+ before { Vedeu::Router.stubs(:goto) }
24
+
25
+ subject { Vedeu.trigger(:_action_, controller, action, **args) }
26
+
27
+ it {
28
+ Vedeu::Router.expects(:goto)
29
+ .with(:some_controller, :show_basket, args)
30
+ subject
31
+ }
32
+ end
33
+
34
+ end # Application
35
+
36
+ end # Bindings
37
+
38
+ end # Vedeu
@@ -0,0 +1,45 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ describe Bindings do
6
+
7
+ let(:described) { Vedeu::Bindings }
8
+
9
+ describe '.setup!' do
10
+ subject { described.setup! }
11
+
12
+ it {
13
+ Vedeu::Bindings::Application.expects(:setup!)
14
+ subject
15
+ }
16
+
17
+ it {
18
+ Vedeu::Bindings::Visibility.expects(:setup!)
19
+ subject
20
+ }
21
+
22
+ it {
23
+ Vedeu::Bindings::Movement.expects(:setup!)
24
+ subject
25
+ }
26
+
27
+ it {
28
+ Vedeu::Bindings::Menus.expects(:setup!)
29
+ subject
30
+ }
31
+
32
+ it {
33
+ Vedeu::Bindings::DRB.expects(:setup!)
34
+ subject
35
+ }
36
+
37
+ it {
38
+ Vedeu::Bindings::System.expects(:setup!)
39
+ subject
40
+ }
41
+ end
42
+
43
+ end # Bindings
44
+
45
+ end # Vedeu
@@ -48,7 +48,7 @@ module Vedeu
48
48
  context 'when the border is enabled' do
49
49
  let(:enabled) { true }
50
50
 
51
- # @todo
51
+ # @todo Add more tests.
52
52
  # it { skip }
53
53
  end
54
54
  end
@@ -166,7 +166,7 @@ module Vedeu
166
166
  subject
167
167
  }
168
168
 
169
- # @todo
169
+ # @todo Add more tests.
170
170
  # it { skip }
171
171
  # it { subject.must_be_instance_of(Array) }
172
172
 
@@ -56,12 +56,12 @@ module Vedeu
56
56
  end
57
57
 
58
58
  context 'when the buffer is not already registered' do
59
- # @todo
59
+ # @todo Add more tests.
60
60
  # it { skip }
61
61
  end
62
62
 
63
63
  context 'when the buffer is already registered' do
64
- # @todo
64
+ # @todo Add more tests.
65
65
  # it { skip }
66
66
  end
67
67
  end
@@ -27,7 +27,7 @@ module Vedeu
27
27
  describe '#generate' do
28
28
  subject { instance.generate }
29
29
 
30
- # @todo
30
+ # @todo Add more tests.
31
31
  end
32
32
 
33
33
  end # Application
@@ -63,7 +63,7 @@ module Vedeu
63
63
 
64
64
  subject { instance.make_file(source, destination) }
65
65
 
66
- # @todo
66
+ # @todo Add more tests.
67
67
  # it { skip }
68
68
  end
69
69
 
@@ -28,11 +28,19 @@ module Vedeu
28
28
  end
29
29
 
30
30
  describe '.coerce' do
31
+ let(:attributes) {
32
+ {
33
+ background: background,
34
+ foreground: foreground,
35
+ }
36
+ }
37
+ let(:background) {}
38
+ let(:foreground) {}
31
39
  let(:_value) {}
32
40
 
33
41
  subject { described.coerce(_value) }
34
42
 
35
- it { subject.must_be_instance_of(described) }
43
+ it { subject.must_be_instance_of(Vedeu::Colour) }
36
44
 
37
45
  context 'when the value is nil' do
38
46
  it { subject.foreground.colour.must_equal('') }
@@ -244,7 +244,7 @@ module Vedeu
244
244
 
245
245
  subject { instance.stdin(io) }
246
246
 
247
- # @todo
247
+ # @todo Add more tests.
248
248
  # it { skip }
249
249
  end
250
250
 
@@ -253,7 +253,7 @@ module Vedeu
253
253
 
254
254
  subject { instance.stdout(io) }
255
255
 
256
- # @todo
256
+ # @todo Add more tests.
257
257
  # it { skip }
258
258
  end
259
259
 
@@ -262,7 +262,7 @@ module Vedeu
262
262
 
263
263
  subject { instance.stderr(io) }
264
264
 
265
- # @todo
265
+ # @todo Add more tests.
266
266
  # it { skip }
267
267
  end
268
268
 
@@ -75,7 +75,7 @@ module Vedeu
75
75
  context 'when the name is not specified' do
76
76
  let(:_name) {}
77
77
 
78
- # @todo
78
+ # @todo Add more tests.
79
79
  # it { skip }
80
80
  end
81
81
 
@@ -248,7 +248,7 @@ module Vedeu
248
248
  context 'when the entity is a Vedeu::Geometry' do
249
249
  let(:entity) { Vedeu::Geometry }
250
250
 
251
- # @todo
251
+ # @todo Add more tests.
252
252
  # it { skip }
253
253
  end
254
254
 
@@ -263,12 +263,12 @@ module Vedeu
263
263
  context 'when the entity is a Vedeu::Geometry' do
264
264
  let(:entity) { Vedeu::Geometry }
265
265
 
266
- # @todo
266
+ # @todo Add more tests.
267
267
  # it { skip }
268
268
  end
269
269
 
270
270
  context 'when the entity is a Vedeu::Cursor' do
271
- # @todo
271
+ # @todo Add more tests.
272
272
  # it { skip }
273
273
  end
274
274
  end
@@ -283,7 +283,7 @@ module Vedeu
283
283
  end
284
284
 
285
285
  context 'when the entity is a Vedeu::Cursor' do
286
- # @todo
286
+ # @todo Add more tests.
287
287
  # it { skip }
288
288
  end
289
289
  end
@@ -54,6 +54,10 @@ module Vedeu
54
54
  end
55
55
  end
56
56
 
57
+ describe '#render' do
58
+ it { instance.must_respond_to(:render) }
59
+ end
60
+
57
61
  end # RefreshCursor
58
62
 
59
63
  end # Vedeu
@@ -37,7 +37,7 @@ module Vedeu
37
37
  end
38
38
 
39
39
  context 'when the DRb server is available' do
40
- # @todo
40
+ # @todo Add more tests.
41
41
  # it { skip }
42
42
  end
43
43
  end
@@ -55,7 +55,7 @@ module Vedeu
55
55
  end
56
56
 
57
57
  context 'when the DRb server is available' do
58
- # @todo
58
+ # @todo Add more tests.
59
59
  # it { skip }
60
60
  end
61
61
  end
@@ -72,7 +72,7 @@ module Vedeu
72
72
  end
73
73
 
74
74
  context 'when the DRb server is available' do
75
- # @todo
75
+ # @todo Add more tests.
76
76
  # it { skip }
77
77
  end
78
78
  end
@@ -87,7 +87,7 @@ module Vedeu
87
87
  end
88
88
 
89
89
  context 'when the DRb server is available' do
90
- # @todo
90
+ # @todo Add more tests.
91
91
  # before do
92
92
  # DRbObject.stubs(:new_with_uri).returns(server)
93
93
  # Process.stubs(:kill)
@@ -35,7 +35,7 @@ module Vedeu
35
35
  describe '.restart' do
36
36
  subject { described.restart }
37
37
 
38
- # @todo
38
+ # @todo Add more tests.
39
39
  # it { skip }
40
40
  # it { subject.must_be_instance_of(NilClass) }
41
41
  context 'when the server is not enabled' do
@@ -45,13 +45,13 @@ module Vedeu
45
45
  context 'when the server is enabled' do
46
46
 
47
47
  context 'and the server is running' do
48
- # @todo
48
+ # @todo Add more tests.
49
49
  # it { subject.must_equal(:running) }
50
50
  # it { skip }
51
51
  end
52
52
 
53
53
  context 'and the server is not running' do
54
- # @todo
54
+ # @todo Add more tests.
55
55
  # it { subject.must_equal(:stopped) }
56
56
  # it { skip }
57
57
  end
@@ -74,13 +74,13 @@ module Vedeu
74
74
  end
75
75
 
76
76
  context 'and the server is running' do
77
- # @todo
77
+ # @todo Add more tests.
78
78
  # it { subject.must_equal(:running) }
79
79
  # it { skip }
80
80
  end
81
81
 
82
82
  context 'and the server is not running' do
83
- # @todo
83
+ # @todo Add more tests.
84
84
  # it { subject.must_equal(:stopped) }
85
85
  # it { skip }
86
86
  end
@@ -100,13 +100,13 @@ module Vedeu
100
100
  context 'when the server is enabled' do
101
101
 
102
102
  context 'and the server is running' do
103
- # @todo
103
+ # @todo Add more tests.
104
104
  # it { subject.must_equal(:running) }
105
105
  # it { skip }
106
106
  end
107
107
 
108
108
  context 'and the server is not running' do
109
- # @todo
109
+ # @todo Add more tests.
110
110
  # it { subject.must_equal(:stopped) }
111
111
  # it { skip }
112
112
  end
@@ -146,13 +146,13 @@ module Vedeu
146
146
  context 'when the server is enabled' do
147
147
 
148
148
  context 'and the server is running' do
149
- # @todo
149
+ # @todo Add more tests.
150
150
  # it { subject.must_equal(:running) }
151
151
  # it { skip }
152
152
  end
153
153
 
154
154
  context 'and the server is not running' do
155
- # @todo
155
+ # @todo Add more tests.
156
156
  # it { subject.must_equal(:stopped) }
157
157
  # it { skip }
158
158
  end
@@ -29,24 +29,24 @@ module Vedeu
29
29
  subject { model_instance.duplicate(_name) }
30
30
 
31
31
  context 'when the model exists' do
32
- # @todo
32
+ # @todo Add more tests.
33
33
  # it { skip }
34
34
  end
35
35
 
36
36
  context 'when the model does not exist' do
37
- # @todo
37
+ # @todo Add more tests.
38
38
  # it { skip }
39
39
  end
40
40
  end
41
41
 
42
42
  describe '#use' do
43
43
  context 'when the model exists' do
44
- # @todo
44
+ # @todo Add more tests.
45
45
  # it { skip }
46
46
  end
47
47
 
48
48
  context 'when the model does not exist' do
49
- # @todo
49
+ # @todo Add more tests.
50
50
  # it { skip }
51
51
  end
52
52
  end
@@ -28,12 +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
+ # @todo Add more tests.
32
32
  # it { skip }
33
33
  end
34
34
 
35
35
  context 'when debugging is not enabled in the configuration' do
36
- # @todo
36
+ # @todo Add more tests.
37
37
  # it { skip }
38
38
  end
39
39
  end
@@ -21,12 +21,12 @@ module Vedeu
21
21
 
22
22
  context 'when the application has started' do
23
23
  context 'when the loop is running' do
24
- # @todo
24
+ # @todo Add more tests.
25
25
  # it { skip }
26
26
  end
27
27
 
28
28
  context 'when the loop is not running' do
29
- # @todo
29
+ # @todo Add more tests.
30
30
  # it { skip }
31
31
  end
32
32
  end
@@ -23,7 +23,7 @@ module Vedeu
23
23
  end
24
24
 
25
25
  context 'when the name is present' do
26
- # @todo
26
+ # @todo Add more tests.
27
27
  # it { skip }
28
28
  end
29
29
  end
@@ -28,7 +28,7 @@ module Vedeu
28
28
  end
29
29
 
30
30
  context 'when there are registered interfaces' do
31
- # @todo
31
+ # @todo Add more tests.
32
32
  # it { skip }
33
33
  end
34
34
  end
@@ -61,7 +61,7 @@ module Vedeu
61
61
  # context 'when the :write_file options is false' do
62
62
  # let(:write_file) { false }
63
63
 
64
- # @todo
64
+ # @todo Add more tests.
65
65
  # # it { skip }
66
66
  # end
67
67
  # end