vedeu 0.4.46 → 0.4.47

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/lib/vedeu/api.rb +3 -3
  3. data/lib/vedeu/bindings/bindings.rb +14 -4
  4. data/lib/vedeu/bindings/drb.rb +2 -0
  5. data/lib/vedeu/bindings/menus.rb +2 -0
  6. data/lib/vedeu/bindings/movement.rb +2 -0
  7. data/lib/vedeu/bindings/visibility.rb +2 -0
  8. data/lib/vedeu/buffers/buffer.rb +1 -1
  9. data/lib/vedeu/cursor/cursor.rb +2 -2
  10. data/lib/vedeu/geometry/dimension.rb +16 -13
  11. data/lib/vedeu/geometry/geometry.rb +3 -1
  12. data/lib/vedeu/geometry/index_position.rb +1 -1
  13. data/lib/vedeu/geometry/position_index.rb +1 -1
  14. data/lib/vedeu/input/input.rb +2 -1
  15. data/lib/vedeu/input/keymap.rb +1 -0
  16. data/lib/vedeu/models/char.rb +7 -6
  17. data/lib/vedeu/models/interface.rb +2 -12
  18. data/lib/vedeu/models/line.rb +2 -2
  19. data/lib/vedeu/models/stream.rb +2 -2
  20. data/lib/vedeu/null/geometry.rb +3 -6
  21. data/lib/vedeu/output/all.rb +1 -1
  22. data/lib/vedeu/output/border.rb +5 -5
  23. data/lib/vedeu/output/clear/all.rb +2 -0
  24. data/lib/vedeu/output/clear/named_group.rb +52 -0
  25. data/lib/vedeu/output/clear/named_interface.rb +99 -0
  26. data/lib/vedeu/output/esc.rb +1 -1
  27. data/lib/vedeu/output/viewport.rb +10 -2
  28. data/lib/vedeu/repositories/registerable.rb +9 -1
  29. data/lib/vedeu/repositories/repositories/borders.rb +0 -11
  30. data/lib/vedeu/repositories/repositories/buffers.rb +0 -11
  31. data/lib/vedeu/repositories/repositories/cursors.rb +4 -11
  32. data/lib/vedeu/repositories/repositories/geometries.rb +0 -11
  33. data/lib/vedeu/repositories/repositories/groups.rb +4 -11
  34. data/lib/vedeu/repositories/repositories/interfaces.rb +0 -11
  35. data/lib/vedeu/repositories/repositories/keymaps.rb +4 -11
  36. data/lib/vedeu/repositories/repositories/menus.rb +4 -11
  37. data/lib/vedeu/repositories/repository.rb +1 -11
  38. data/lib/vedeu/storage/store.rb +15 -0
  39. data/lib/vedeu/support/log.rb +1 -0
  40. data/lib/vedeu/support/terminal.rb +1 -10
  41. data/lib/vedeu/support/visibility.rb +0 -1
  42. data/lib/vedeu/version.rb +1 -1
  43. data/test/lib/vedeu/geometry/geometry_test.rb +4 -0
  44. data/test/lib/vedeu/geometry/position_test.rb +25 -8
  45. data/test/lib/vedeu/models/char_test.rb +4 -4
  46. data/test/lib/vedeu/models/interface_test.rb +7 -2
  47. data/test/lib/vedeu/output/clear/named_group_test.rb +41 -0
  48. data/test/lib/vedeu/output/clear/named_interface_test.rb +68 -0
  49. data/test/lib/vedeu/output/render_border_test.rb +47 -5
  50. data/test/lib/vedeu/repositories/registerable_test.rb +30 -3
  51. data/test/lib/vedeu/repositories/repositories/borders_test.rb +0 -13
  52. data/test/lib/vedeu/repositories/repositories/buffers_test.rb +0 -11
  53. data/test/lib/vedeu/repositories/repositories/cursors_test.rb +0 -11
  54. data/test/lib/vedeu/repositories/repositories/geometries_test.rb +0 -11
  55. data/test/lib/vedeu/repositories/repositories/groups_test.rb +0 -11
  56. data/test/lib/vedeu/repositories/repositories/interfaces_test.rb +0 -11
  57. data/test/lib/vedeu/repositories/repositories/keymaps_test.rb +0 -11
  58. data/test/lib/vedeu/repositories/repositories/menus_test.rb +0 -11
  59. data/test/lib/vedeu/repositories/repository_test.rb +0 -37
  60. data/test/lib/vedeu/storage/store_test.rb +41 -0
  61. data/test/test_helper.rb +3 -1
  62. metadata +9 -5
  63. data/lib/vedeu/output/clear.rb +0 -207
  64. data/test/lib/vedeu/output/clear_test.rb +0 -105
@@ -1,105 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- describe Clear do
6
-
7
- let(:described) { Vedeu::Clear }
8
- let(:instance) { described.new(interface, options) }
9
- let(:interface) { Vedeu::Interface.new(name: 'xenon', visible: visible) }
10
- let(:options) { {} }
11
- let(:visible) { true }
12
- let(:drb) { false }
13
-
14
- before do
15
- Vedeu::Border.new(name: 'xenon').store
16
- Vedeu::Geometry.new(name: 'xenon', x: 1, y: 1, xn: 3, yn: 3).store
17
- Vedeu::Configuration.stubs(:drb?).returns(drb)
18
- Vedeu.renderers.stubs(:render)
19
- end
20
- after do
21
- Vedeu.borders.reset
22
- Vedeu.geometries.reset
23
- end
24
-
25
- describe '#initialize' do
26
- it { instance.must_be_instance_of(described) }
27
- it { instance.instance_variable_get('@interface').must_equal(interface) }
28
- it { instance.instance_variable_get('@options').must_equal(options) }
29
- end
30
-
31
- describe 'alias methods' do
32
- it { described.must_respond_to(:render) }
33
- end
34
-
35
- describe '.by_group' do
36
- let(:group) {}
37
-
38
- subject { described.by_group(group) }
39
-
40
- it { described.must_respond_to(:by_group) }
41
-
42
- context 'when no group is given' do
43
- it { subject.must_equal(nil) }
44
- end
45
- end
46
-
47
- describe '.by_name' do
48
- subject { described.by_name(_name) }
49
-
50
- it { described.must_respond_to(:by_name) }
51
- end
52
-
53
- describe '.clear' do
54
- subject { described.clear(interface, options) }
55
-
56
- context 'when the interface is visible' do
57
- # it { skip }
58
- # it { subject.must_be_instance_of(Array) }
59
- end
60
-
61
- context 'when the interface is not visible' do
62
- let(:visible) { false }
63
-
64
- it { subject.must_be_instance_of(Array) }
65
-
66
- it { subject.must_equal([]) }
67
- end
68
- end
69
-
70
- describe '#clear' do
71
- subject { instance.clear }
72
-
73
- it { subject.must_be_instance_of(Array) }
74
- it { subject.flatten.size.must_equal(9) }
75
-
76
- context 'when the interface is visible' do
77
- # it { skip }
78
- # it { subject.must_be_instance_of(Array) }
79
- end
80
-
81
- context 'when the interface is not visible' do
82
- let(:visible) { false }
83
-
84
- it { subject.must_equal([]) }
85
- end
86
- end
87
-
88
- describe '#write' do
89
- subject { instance.write }
90
-
91
- context 'when the interface is visible' do
92
- # it { skip }
93
- # it { subject.must_be_instance_of(Array) }
94
- end
95
-
96
- context 'when the interface is not visible' do
97
- let(:visible) { false }
98
-
99
- it { subject.must_be_instance_of(NilClass) }
100
- end
101
- end
102
-
103
- end # Clear
104
-
105
- end # Vedeu