vedeu 0.6.20 → 0.6.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -1
  3. data/README.md +4 -0
  4. data/Rakefile +13 -0
  5. data/bin/vedeu_drb_server +6 -6
  6. data/docs/api.md +14 -0
  7. data/docs/dsl.md +12 -12
  8. data/docs/events/document.md +4 -2
  9. data/docs/events/drb.md +4 -0
  10. data/docs/events/focus.md +2 -0
  11. data/docs/events/menu.md +2 -0
  12. data/docs/events/movement.md +7 -5
  13. data/docs/events/refresh.md +2 -0
  14. data/docs/events/system.md +5 -0
  15. data/docs/events/view.md +2 -0
  16. data/docs/events/visibility.md +2 -0
  17. data/lib/vedeu.rb +0 -23
  18. data/lib/vedeu/all.rb +2 -4
  19. data/lib/vedeu/application/application_view.rb +1 -1
  20. data/lib/vedeu/borders/all.rb +3 -3
  21. data/lib/vedeu/borders/border.rb +2 -2
  22. data/lib/vedeu/borders/dsl.rb +21 -27
  23. data/lib/vedeu/borders/null.rb +2 -15
  24. data/lib/vedeu/borders/render.rb +1 -1
  25. data/lib/vedeu/borders/repository.rb +9 -0
  26. data/lib/vedeu/buffers/buffer.rb +2 -2
  27. data/lib/vedeu/buffers/null.rb +1 -31
  28. data/lib/vedeu/buffers/refresh.rb +8 -8
  29. data/lib/vedeu/buffers/repository.rb +9 -0
  30. data/lib/vedeu/colours/backgrounds.rb +9 -0
  31. data/lib/vedeu/colours/colour.rb +1 -1
  32. data/lib/vedeu/colours/foregrounds.rb +9 -0
  33. data/lib/vedeu/common.rb +22 -13
  34. data/lib/vedeu/configuration/configuration.rb +6 -0
  35. data/lib/vedeu/cursors/cursor.rb +13 -8
  36. data/lib/vedeu/cursors/refresh.rb +2 -2
  37. data/lib/vedeu/cursors/repository.rb +18 -1
  38. data/lib/vedeu/distributed/server.rb +23 -0
  39. data/lib/vedeu/distributed/templates/default_borders.vedeu +1 -1
  40. data/lib/vedeu/distributed/templates/default_geometries.vedeu +1 -1
  41. data/lib/vedeu/distributed/templates/default_interfaces.vedeu +1 -1
  42. data/lib/vedeu/distributed/templates/default_keymaps.vedeu +1 -1
  43. data/lib/vedeu/distributed/templates/default_menus.vedeu +1 -1
  44. data/lib/vedeu/distributed/templates/default_views.vedeu +1 -1
  45. data/lib/vedeu/dsl/composition.rb +7 -17
  46. data/lib/vedeu/dsl/dsl.rb +12 -0
  47. data/lib/vedeu/dsl/interface.rb +32 -33
  48. data/lib/vedeu/dsl/keymap.rb +13 -19
  49. data/lib/vedeu/dsl/line.rb +3 -13
  50. data/lib/vedeu/dsl/shared.rb +5 -5
  51. data/lib/vedeu/dsl/stream.rb +0 -10
  52. data/lib/vedeu/dsl/use.rb +6 -6
  53. data/lib/vedeu/dsl/view.rb +17 -19
  54. data/lib/vedeu/editor/cursor.rb +32 -10
  55. data/lib/vedeu/editor/document.rb +33 -35
  56. data/lib/vedeu/editor/editor.rb +3 -4
  57. data/lib/vedeu/editor/insert.rb +1 -1
  58. data/lib/vedeu/editor/line.rb +1 -8
  59. data/lib/vedeu/editor/lines.rb +1 -1
  60. data/lib/vedeu/editor/repository.rb +9 -0
  61. data/lib/vedeu/esc/esc.rb +2 -1
  62. data/lib/vedeu/events/aliases.rb +8 -1
  63. data/lib/vedeu/events/event.rb +8 -0
  64. data/lib/vedeu/events/repository.rb +9 -0
  65. data/lib/vedeu/events/trigger.rb +9 -5
  66. data/lib/vedeu/geometry/coordinate.rb +2 -2
  67. data/lib/vedeu/geometry/dsl.rb +32 -38
  68. data/lib/vedeu/geometry/generic_coordinate.rb +1 -1
  69. data/lib/vedeu/geometry/geometry.rb +3 -3
  70. data/lib/vedeu/geometry/null.rb +2 -24
  71. data/lib/vedeu/geometry/repository.rb +9 -0
  72. data/lib/vedeu/groups/clear.rb +7 -3
  73. data/lib/vedeu/groups/dsl.rb +29 -35
  74. data/lib/vedeu/groups/group.rb +28 -4
  75. data/lib/vedeu/groups/refresh.rb +3 -2
  76. data/lib/vedeu/groups/repository.rb +9 -0
  77. data/lib/vedeu/input/capture.rb +1 -1
  78. data/lib/vedeu/input/keymap.rb +2 -1
  79. data/lib/vedeu/input/keymaps.rb +9 -0
  80. data/lib/vedeu/input/mapper.rb +4 -0
  81. data/lib/vedeu/input/translator.rb +1 -1
  82. data/lib/vedeu/logging/debug.rb +13 -0
  83. data/lib/vedeu/logging/log.rb +8 -0
  84. data/lib/vedeu/logging/timer.rb +13 -0
  85. data/lib/vedeu/menus/dsl.rb +8 -18
  86. data/lib/vedeu/menus/menu.rb +8 -4
  87. data/lib/vedeu/menus/null.rb +1 -1
  88. data/lib/vedeu/menus/repository.rb +9 -0
  89. data/lib/vedeu/models/cell.rb +5 -0
  90. data/lib/vedeu/models/escape.rb +5 -0
  91. data/lib/vedeu/models/focus.rb +20 -5
  92. data/lib/vedeu/models/interface.rb +10 -1
  93. data/lib/vedeu/models/interfaces.rb +9 -0
  94. data/lib/vedeu/models/toggleable.rb +19 -4
  95. data/lib/vedeu/models/views/char.rb +6 -1
  96. data/lib/vedeu/models/views/html_char.rb +1 -4
  97. data/lib/vedeu/models/views/line.rb +1 -1
  98. data/lib/vedeu/models/views/view.rb +1 -1
  99. data/lib/vedeu/null/generic.rb +14 -2
  100. data/lib/vedeu/null/interface.rb +1 -1
  101. data/lib/vedeu/null/view.rb +1 -1
  102. data/lib/vedeu/output/clear/interface.rb +5 -1
  103. data/lib/vedeu/output/compressor.rb +8 -4
  104. data/lib/vedeu/output/direct.rb +4 -4
  105. data/lib/vedeu/output/presentation/all.rb +15 -0
  106. data/lib/vedeu/output/presentation/presentation.rb +0 -7
  107. data/lib/vedeu/output/refresh/refresh.rb +1 -3
  108. data/lib/vedeu/output/renderers/all.rb +10 -0
  109. data/lib/vedeu/output/renderers/terminal.rb +1 -3
  110. data/lib/vedeu/repositories/collection.rb +3 -3
  111. data/lib/vedeu/repositories/model.rb +1 -1
  112. data/lib/vedeu/repositories/repository.rb +8 -8
  113. data/lib/vedeu/repositories/store.rb +3 -2
  114. data/lib/vedeu/runtime/application.rb +4 -0
  115. data/lib/vedeu/runtime/bootstrap.rb +1 -1
  116. data/lib/vedeu/runtime/flags.rb +7 -0
  117. data/lib/vedeu/runtime/main_loop.rb +2 -0
  118. data/lib/vedeu/runtime/router.rb +4 -0
  119. data/lib/vedeu/templating/decoder.rb +1 -1
  120. data/lib/vedeu/templating/encoder.rb +1 -1
  121. data/lib/vedeu/templating/helpers.rb +2 -0
  122. data/lib/vedeu/templating/template.rb +1 -1
  123. data/lib/vedeu/terminal/buffer.rb +7 -0
  124. data/lib/vedeu/terminal/terminal.rb +8 -0
  125. data/lib/vedeu/version.rb +1 -1
  126. data/test/lib/vedeu/borders/dsl_test.rb +0 -6
  127. data/test/lib/vedeu/borders/null_test.rb +0 -12
  128. data/test/lib/vedeu/buffers/null_test.rb +0 -37
  129. data/test/lib/vedeu/common_test.rb +33 -0
  130. data/test/lib/vedeu/cursors/cursor_test.rb +1 -1
  131. data/test/lib/vedeu/dsl/composition_test.rb +0 -6
  132. data/test/lib/vedeu/dsl/dsl_test.rb +1 -0
  133. data/test/lib/vedeu/dsl/interface_test.rb +0 -6
  134. data/test/lib/vedeu/dsl/keymap_test.rb +0 -5
  135. data/test/lib/vedeu/dsl/line_test.rb +0 -7
  136. data/test/lib/vedeu/dsl/stream_test.rb +0 -7
  137. data/test/lib/vedeu/editor/cursor_test.rb +23 -8
  138. data/test/lib/vedeu/editor/document_test.rb +27 -23
  139. data/test/lib/vedeu/editor/line_test.rb +0 -30
  140. data/test/lib/vedeu/geometry/dsl_test.rb +0 -5
  141. data/test/lib/vedeu/geometry/null_test.rb +0 -30
  142. data/test/lib/vedeu/groups/dsl_test.rb +0 -6
  143. data/test/lib/vedeu/groups/group_test.rb +15 -7
  144. data/test/lib/vedeu/menus/dsl_test.rb +0 -5
  145. data/test/lib/vedeu/models/cell_test.rb +4 -0
  146. data/test/lib/vedeu/models/escape_test.rb +4 -0
  147. data/test/lib/vedeu/models/views/char_test.rb +4 -0
  148. data/test/lib/vedeu/null/generic_test.rb +13 -0
  149. data/test/lib/vedeu/terminal/buffer_test.rb +3 -2
  150. data/test/lib/vedeu_test.rb +81 -3
  151. data/test/support/examples/borders_app.rb +1 -3
  152. data/test/support/examples/drb_app.rb +1 -3
  153. data/test/support/examples/editor_app.rb +2 -4
  154. data/test/support/examples/focus_app.rb +1 -3
  155. data/test/support/examples/hello_world.rb +1 -6
  156. data/test/support/examples/material_colours_app.rb +1 -3
  157. data/test/support/examples/view_templates_app/view_templates_app.rb +1 -3
  158. data/test/support/helpers/model_test_class.rb +1 -5
  159. data/test/support/who.rb +29 -0
  160. data/test/test_helper.rb +0 -1
  161. metadata +5 -17
  162. data/lib/vedeu/api/all.rb +0 -15
  163. data/lib/vedeu/api/external.rb +0 -194
  164. data/lib/vedeu/api/internal.rb +0 -177
  165. data/test/lib/vedeu/api/external_test.rb +0 -74
  166. data/test/lib/vedeu/api/internal_test.rb +0 -33
  167. data/test/support/examples/typed_commands/command.erb +0 -1
  168. data/test/support/examples/typed_commands/output.erb +0 -1
  169. data/test/support/examples/typed_commands/status.erb +0 -1
  170. data/test/support/examples/typed_commands/typed_commands_app.rb +0 -94
@@ -1,12 +1,5 @@
1
- require 'vedeu/output/presentation/colour'
2
- require 'vedeu/output/presentation/styles'
3
- require 'vedeu/output/presentation/style'
4
-
5
1
  module Vedeu
6
2
 
7
- # This module allows the sharing of presentation concerns between
8
- # the models: Interface, View, Line and Stream.
9
- #
10
3
  module Presentation
11
4
 
12
5
  include Vedeu::Presentation::Colour
@@ -5,9 +5,7 @@ module Vedeu
5
5
  # @see Vedeu::Bindings::System#refresh!
6
6
  class Refresh
7
7
 
8
- # Refresh all registered interfaces.
9
- #
10
- # @return [Array<Vedeu::Models::Interface>]
8
+ # @see #all
11
9
  def self.all
12
10
  new.all
13
11
  end
@@ -104,6 +104,16 @@ module Vedeu
104
104
 
105
105
  end # Renderers
106
106
 
107
+ # @example
108
+ # Vedeu.renderer
109
+ # Vedeu.renderers
110
+ #
111
+ # @!method renderer
112
+ # @see Vedeu::Renderers#renderer
113
+ # @!method renderers
114
+ # @see Vedeu::Renderers#renderers
115
+ def_delegators Vedeu::Renderers, :renderer, :renderers
116
+
107
117
  end # Vedeu
108
118
 
109
119
  require 'vedeu/output/renderers/options'
@@ -27,9 +27,7 @@ module Vedeu
27
27
  # @param output [Vedeu::Models::Page]
28
28
  # @return [Array<String>]
29
29
  def render(output)
30
- output = parse(output)
31
-
32
- Vedeu::Terminal.output(output)
30
+ Vedeu::Terminal.output(parse(output))
33
31
  end
34
32
 
35
33
  private
@@ -19,12 +19,12 @@ module Vedeu
19
19
  attr_accessor :parent
20
20
 
21
21
  # @!attribute [rw] name
22
- # @return [String]
22
+ # @return [String|Symbol|NilClass]
23
23
  attr_accessor :name
24
24
 
25
25
  # @param collection [Array|Vedeu::Repositories::Collection]
26
26
  # @param parent [void]
27
- # @param name [String|NilClass]
27
+ # @param name [String|Symbol|NilClass]
28
28
  # @return [Vedeu::Repositories::Collection]
29
29
  def self.coerce(collection = [], parent = nil, name = nil)
30
30
  if collection.is_a?(Vedeu::Repositories::Collection)
@@ -40,7 +40,7 @@ module Vedeu
40
40
  #
41
41
  # @param collection [void]
42
42
  # @param parent [void]
43
- # @param name [String|NilClass]
43
+ # @param name [String|Symbol|NilClass]
44
44
  # @return [Vedeu::Repositories::Collection]
45
45
  def initialize(collection = [], parent = nil, name = nil)
46
46
  @collection = collection
@@ -45,7 +45,7 @@ module Vedeu
45
45
 
46
46
  # Fetch an instance of a repository's model by name.
47
47
  #
48
- # @param name [String]
48
+ # @param name [String|Symbol]
49
49
  # @return [void]
50
50
  def by_name(name)
51
51
  repository.by_name(name) if repository
@@ -55,12 +55,12 @@ module Vedeu
55
55
  # @example
56
56
  # # Fetch the cursor belonging to the interface of the same
57
57
  # # name.
58
- # Vedeu.cursors.by_name('some_name')
58
+ # Vedeu.cursors.by_name(:some_name)
59
59
  #
60
60
  # # Fetch the names of the interfaces belonging to this group.
61
61
  # Vedeu.groups.by_name(name)
62
62
  #
63
- # @param name [String] The name of the stored model.
63
+ # @param name [String|Symbol] The name of the stored model.
64
64
  # @return [void]
65
65
  def by_name(name)
66
66
  name ||= Vedeu.focus
@@ -79,7 +79,7 @@ module Vedeu
79
79
 
80
80
  # Find the model by name.
81
81
  #
82
- # @param name [String]
82
+ # @param name [String|Symbol]
83
83
  # @return [Hash<String => Object>|NilClass]
84
84
  def find(name)
85
85
  storage[name]
@@ -88,7 +88,7 @@ module Vedeu
88
88
  # Find the model attributes by name, raises an exception when
89
89
  # the model cannot be found.
90
90
  #
91
- # @param name [String]
91
+ # @param name [String|Symbol]
92
92
  # @raise [Vedeu::Error::ModelNotFound] When the model cannot be
93
93
  # found with this name.
94
94
  # @return [Hash<String => Object>]
@@ -100,7 +100,7 @@ module Vedeu
100
100
  # Find a model by name, registers the model by name when not
101
101
  # found.
102
102
  #
103
- # @param name [String]
103
+ # @param name [String|Symbol]
104
104
  # @return [void]
105
105
  def find_or_create(name)
106
106
  return find(name) if registered?(name)
@@ -119,10 +119,10 @@ module Vedeu
119
119
  # Returns a boolean indicating whether the named model is
120
120
  # registered.
121
121
  #
122
- # @param name [String]
122
+ # @param name [String|Symbol]
123
123
  # @return [Boolean]
124
124
  def registered?(name)
125
- return false if name.nil? || name.empty?
125
+ return false if absent?(name)
126
126
  return false if empty?
127
127
 
128
128
  storage.include?(name)
@@ -131,7 +131,7 @@ module Vedeu
131
131
  # Returns the storage with the named model removed, or false
132
132
  # when the model does not exist.
133
133
  #
134
- # @param name [String]
134
+ # @param name [String|Symbol]
135
135
  # @return [Hash|FalseClass]
136
136
  def remove(name)
137
137
  return false if empty?
@@ -7,6 +7,7 @@ module Vedeu
7
7
  module Store
8
8
 
9
9
  include Enumerable
10
+ include Vedeu::Common
10
11
 
11
12
  # @param block [Proc]
12
13
  # @return [Enumerator]
@@ -24,10 +25,10 @@ module Vedeu
24
25
  # Returns a boolean indicating whether the named model is
25
26
  # registered.
26
27
  #
27
- # @param name [String]
28
+ # @param name [String|Symbol]
28
29
  # @return [Boolean]
29
30
  def exists?(name)
30
- return false if empty? || name.nil? || name.empty?
31
+ return false if empty? || absent?(name)
31
32
 
32
33
  storage.include?(name)
33
34
  end
@@ -132,4 +132,8 @@ module Vedeu
132
132
 
133
133
  end # Runtime
134
134
 
135
+ # @!method exit
136
+ # @see Vedeu::Runtime::Application.stop
137
+ def_delegators Vedeu::Runtime::Application, :exit
138
+
135
139
  end # Vedeu
@@ -10,7 +10,7 @@ module Vedeu
10
10
  #
11
11
  class Bootstrap
12
12
 
13
- # @param argv [Array<String>]
13
+ # @param (see #initialize)
14
14
  # @return [void]
15
15
  def self.start(argv = ARGV)
16
16
  new(argv).start
@@ -58,4 +58,11 @@ module Vedeu
58
58
 
59
59
  end # Runtime
60
60
 
61
+ # Manipulate the internal flags.
62
+ #
63
+ # @!method ready?
64
+ # @!method ready!
65
+ # @return [Boolean]
66
+ def_delegators Vedeu::Runtime::Flags, :ready?, :ready!
67
+
61
68
  end # Vedeu
@@ -26,6 +26,8 @@ module Vedeu
26
26
 
27
27
  Vedeu.trigger(:_hide_cursor_)
28
28
 
29
+ Vedeu.log(type: :info,
30
+ message: 'MainLoop rendering terminal buffer.')
29
31
  Vedeu::Terminal::Buffer.render
30
32
 
31
33
  Vedeu.trigger(:_show_cursor_)
@@ -187,4 +187,8 @@ module Vedeu
187
187
 
188
188
  end # Runtime
189
189
 
190
+ # @!method goto
191
+ # @see Vedeu::Runtime::Router#goto
192
+ def_delegators Vedeu::Runtime::Router, :goto
193
+
190
194
  end # Vedeu
@@ -7,7 +7,7 @@ module Vedeu
7
7
  #
8
8
  class Decoder
9
9
 
10
- # @param data [String]
10
+ # @param (see #initialize)
11
11
  # @return [Object]
12
12
  def self.process(data)
13
13
  new(data).process
@@ -7,7 +7,7 @@ module Vedeu
7
7
  #
8
8
  class Encoder
9
9
 
10
- # @param data [Object]
10
+ # @param (see #initialize)
11
11
  # @return [String]
12
12
  def self.process(data)
13
13
  new(data).process
@@ -6,6 +6,8 @@ module Vedeu
6
6
  #
7
7
  module Helpers
8
8
 
9
+ include Vedeu::View
10
+
9
11
  # @param value [String] The HTML/CSS colour.
10
12
  # @param block [Proc]
11
13
  # @raise [Vedeu::Error::RequiresBlock]
@@ -17,7 +17,7 @@ module Vedeu
17
17
  # @param object [Class]
18
18
  # @param path [String]
19
19
  # @param options [Hash]
20
- # @option options name [String] The name of an interface.
20
+ # @option options name [String|Symbol] The name of an interface.
21
21
  # @return [Vedeu::Templating::Template]
22
22
  def initialize(object, path, options = {})
23
23
  @object = object
@@ -26,6 +26,9 @@ module Vedeu
26
26
 
27
27
  # Clear the output.
28
28
  #
29
+ # @example
30
+ # Vedeu.clear
31
+ #
29
32
  # @return [String|void] Most likely to be a String.
30
33
  def clear
31
34
  reset
@@ -137,4 +140,8 @@ module Vedeu
137
140
 
138
141
  end # Terminal
139
142
 
143
+ # @!method clear
144
+ # @see Vedeu::Terminal::Buffer#clear
145
+ def_delegators Vedeu::Terminal::Buffer, :clear
146
+
140
147
  end # Vedeu
@@ -216,4 +216,12 @@ module Vedeu
216
216
 
217
217
  end # Terminal
218
218
 
219
+ # @!method height
220
+ # @see Vedeu::Terminal#height
221
+ # @!method resize
222
+ # @see Vedeu::Terminal#resize
223
+ # @!method width
224
+ # @see Vedeu::Terminal#width
225
+ def_delegators Vedeu::Terminal, :height, :resize, :width
226
+
219
227
  end # Vedeu
data/lib/vedeu/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Vedeu
2
2
 
3
3
  # The current version of Vedeu.
4
- VERSION = '0.6.20'
4
+ VERSION = '0.6.21'
5
5
 
6
6
  end
@@ -13,12 +13,6 @@ module Vedeu
13
13
  let(:attributes) { { name: 'borders' } }
14
14
  let(:boolean) { true }
15
15
 
16
- describe '#initialize' do
17
- it { instance.must_be_instance_of(described) }
18
- it { instance.instance_variable_get('@model').must_equal(model) }
19
- it { instance.instance_variable_get('@client').must_equal(client) }
20
- end
21
-
22
16
  describe '.border' do
23
17
  it { described.must_respond_to(:border) }
24
18
  end
@@ -60,12 +60,6 @@ module Vedeu
60
60
  it { subject.must_equal(12) }
61
61
  end
62
62
 
63
- describe '#enabled?' do
64
- subject { instance.enabled? }
65
-
66
- it { subject.must_be_instance_of(FalseClass) }
67
- end
68
-
69
63
  describe '#height' do
70
64
  subject { instance.height }
71
65
 
@@ -73,12 +67,6 @@ module Vedeu
73
67
  it { subject.must_equal(7) }
74
68
  end
75
69
 
76
- describe '#null?' do
77
- subject { instance.null? }
78
-
79
- it { subject.must_be_instance_of(TrueClass) }
80
- end
81
-
82
70
  describe '#render' do
83
71
  subject { instance.render }
84
72
 
@@ -7,43 +7,6 @@ module Vedeu
7
7
  describe Null do
8
8
 
9
9
  let(:described) { Vedeu::Buffers::Null }
10
- let(:instance) { described.new(attributes) }
11
- let(:attributes){
12
- {
13
- name: _name
14
- }
15
- }
16
- let(:_name) { 'null_buffer' }
17
-
18
- describe '#initialize' do
19
- it { instance.must_be_instance_of(described) }
20
- it {
21
- instance.instance_variable_get('@attributes').must_equal(attributes)
22
- }
23
- it { instance.instance_variable_get('@name').must_equal(_name) }
24
- end
25
-
26
- describe 'accessors' do
27
- it { instance.must_respond_to(:name) }
28
- end
29
-
30
- describe '#null' do
31
- subject { instance.null }
32
-
33
- it { subject.must_be_instance_of(NilClass) }
34
-
35
- it { instance.must_respond_to(:clear) }
36
- it { instance.must_respond_to(:hide) }
37
- it { instance.must_respond_to(:render) }
38
- it { instance.must_respond_to(:show) }
39
- it { instance.must_respond_to(:toggle) }
40
- end
41
-
42
- describe '#null?' do
43
- subject { instance.null? }
44
-
45
- it { subject.must_be_instance_of(TrueClass) }
46
- end
47
10
 
48
11
  end # Null
49
12
 
@@ -10,6 +10,10 @@ module Vedeu
10
10
  present?(variable)
11
11
  end
12
12
 
13
+ def undefined_value_test(variable)
14
+ absent?(variable)
15
+ end
16
+
13
17
  end # VedeuCommonClass
14
18
 
15
19
  describe Common do
@@ -17,6 +21,35 @@ module Vedeu
17
21
  let(:described) { Vedeu::VedeuCommonClass }
18
22
  let(:instance) { described.new }
19
23
 
24
+ describe '#absent?' do
25
+ subject { instance.undefined_value_test(_value) }
26
+
27
+ context 'when the variable is a Fixnum' do
28
+ let(:_value) { 17 }
29
+
30
+ it { subject.must_equal(false) }
31
+ end
32
+
33
+ context 'when the variable is not nil or empty' do
34
+ let(:_value) { 'not empty' }
35
+
36
+ it { subject.must_equal(false) }
37
+ end
38
+
39
+ context 'when the variable is nil or empty' do
40
+ let(:_value) { [] }
41
+
42
+ it { subject.must_equal(true) }
43
+ end
44
+
45
+ context 'when dealing with keys which may not exist or have a value' do
46
+ let(:attributes) { {} }
47
+ let(:_value) { attributes[:not_found] }
48
+
49
+ it { subject.must_equal(true) }
50
+ end
51
+ end
52
+
20
53
  describe '#demodulize' do
21
54
  let(:klass) { described }
22
55
 
@@ -68,7 +68,7 @@ module Vedeu
68
68
  instance.must_respond_to(:ox=)
69
69
  instance.must_respond_to(:oy)
70
70
  instance.must_respond_to(:oy=)
71
- instance.must_respond_to(:state)
71
+ instance.must_respond_to(:visible)
72
72
  instance.must_respond_to(:x=)
73
73
  instance.must_respond_to(:y=)
74
74
  }