vedeu 0.4.48 → 0.4.49

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5ceca13f9b58a2952c6d8805faf464dabeb3610
4
- data.tar.gz: e588afaa1dfde0bd1d6f2297880621f5399fdb0e
3
+ metadata.gz: aba52b40e7308a950ef038f55ad681f6605aa57f
4
+ data.tar.gz: c1040133b462db4cc0fd796674b8c0c7f2965c81
5
5
  SHA512:
6
- metadata.gz: 45ef186c4d5da19d0d482a0ce89772f8de5e135dd974e6526370ffa13078b2d33ac905aec0abeaa863f930d62a96917613eb4fe1de3c63e9a6bf5c1550502293
7
- data.tar.gz: e2c3aa1c381a0e4c9912f14bccbc66b2ec1242c53a9c20544bf3e894b6cb350e04bcdd786995f15382e195a565b5882ff61bb0bf7d36a33d26a72a086f8ffd51
6
+ metadata.gz: b0c936fd80c9b324ffe99a7e800ae7571510bb7c9714512c7db7e1da643f6b3b9a8d698f3f762aeaa50d376a1fd880d0e22130c6af596b4da4d7cd3531c53ff1
7
+ data.tar.gz: de9ca0380433479fc06ccbd95dde1836c65e9085abb76dbc6d5049a053e99e968dd6118591ac7293ddc48c2a9ca3aa7f6ade8df0aa3e10d8c170dca256992b43
data/lib/vedeu/api.rb CHANGED
@@ -115,9 +115,11 @@ module Vedeu
115
115
 
116
116
  # @!method bind
117
117
  # @see Vedeu::Event.bind
118
+ # @!method bound?
119
+ # @see Vedeu::Event.bound?
118
120
  # @!method unbind
119
121
  # @see Vedeu::Event.unbind
120
- def_delegators Vedeu::Event, :bind, :unbind
122
+ def_delegators Vedeu::Event, :bind, :bound?, :unbind
121
123
 
122
124
  # Manipulate the repository of events.
123
125
  #
data/lib/vedeu/dsl/use.rb CHANGED
@@ -32,9 +32,13 @@ module Vedeu
32
32
  # @param name [String] The name of the model to duplicate.
33
33
  # @return [void] The new model based on the original.
34
34
  def duplicate(name)
35
- duplicated = model.repository.by_name(name).dup
36
- duplicated.name = model.name
37
- duplicated.store
35
+ original = model.repository.by_name(name)
36
+
37
+ unless original.respond_to?(:null?)
38
+ duplicated = original.dup
39
+ duplicated.name = model.name
40
+ duplicated.store
41
+ end
38
42
  end
39
43
 
40
44
  # Use the attribute of stored model.
@@ -88,17 +88,28 @@ module Vedeu
88
88
  alias_method :event, :bind
89
89
  alias_method :register, :bind
90
90
 
91
+ # Return a boolean indicating whether the named event is registered.
92
+ #
93
+ # @example
94
+ # Vedeu.bound?(:some_event)
95
+ #
96
+ # @param name [Symbol]
97
+ # @return [Boolean]
98
+ def bound?(name)
99
+ Vedeu.events.registered?(name)
100
+ end
101
+
91
102
  # Unbind events from a named handler.
92
103
  #
93
104
  # Removes all events associated with the given name.
94
105
  #
95
106
  # @example
96
- # Vedeu.unbind('some_event')
107
+ # Vedeu.unbind(:some_event)
97
108
  #
98
- # @param name [String]
109
+ # @param name [Symbol]
99
110
  # @return [Boolean]
100
111
  def unbind(name)
101
- return false unless Vedeu.events.registered?(name)
112
+ return false unless Vedeu.bound?(name)
102
113
 
103
114
  Vedeu.log(type: :event, message: "Unbinding: '#{name.inspect}'")
104
115
 
@@ -49,12 +49,10 @@ module Vedeu
49
49
  # border 'piece' this Char represents.
50
50
  # @return [Char]
51
51
  def initialize(attributes = {})
52
- @attributes = defaults.merge!(attributes)
53
-
54
- @border = @attributes[:border]
55
- @parent = @attributes[:parent]
56
- @value = @attributes[:value]
57
- @position = Vedeu::Position.coerce(@attributes[:position])
52
+ @attributes = attributes
53
+ @border = @attributes[:border]
54
+ @parent = @attributes[:parent]
55
+ @value = @attributes[:value]
58
56
  end
59
57
 
60
58
  # When {Vedeu::Viewport#padded_lines} has less lines that required to fill
@@ -85,6 +83,11 @@ module Vedeu
85
83
  "<Vedeu::Char '#{Vedeu::Esc.escape(to_s)}'>"
86
84
  end
87
85
 
86
+ # @return [Vedeu::Position]
87
+ def position
88
+ @position = Vedeu::Position.coerce(@attributes[:position])
89
+ end
90
+
88
91
  # Sets the position of the Char.
89
92
  #
90
93
  # @param value [Vedeu::Position]
@@ -151,20 +154,6 @@ module Vedeu
151
154
  }
152
155
  end
153
156
 
154
- # The default values for a new instance of this class.
155
- #
156
- # @return [Hash]
157
- def defaults
158
- {
159
- border: nil,
160
- colour: nil,
161
- parent: nil,
162
- position: nil,
163
- style: nil,
164
- value: '',
165
- }
166
- end
167
-
168
157
  # @return [Hash]
169
158
  def parent_to_hash
170
159
  {
@@ -57,6 +57,11 @@ module Vedeu
57
57
  (by..byn).size
58
58
  end
59
59
 
60
+ # @return [Boolean]
61
+ def null?
62
+ true
63
+ end
64
+
60
65
  # @return [Array]
61
66
  def render
62
67
  []
@@ -30,6 +30,11 @@ module Vedeu
30
30
  nil
31
31
  end
32
32
 
33
+ # @return [Boolean]
34
+ def null?
35
+ true
36
+ end
37
+
33
38
  # @return [NilClass]
34
39
  def render
35
40
  nil
@@ -22,6 +22,11 @@ module Vedeu
22
22
  nil
23
23
  end
24
24
 
25
+ # @return [Boolean]
26
+ def null?
27
+ true
28
+ end
29
+
25
30
  # @return [NilClass]
26
31
  def parent
27
32
  nil
@@ -54,6 +54,11 @@ module Vedeu
54
54
  alias_method :maximise, :maximised?
55
55
  alias_method :unmaximise, :maximised?
56
56
 
57
+ # @return [Boolean]
58
+ def null?
59
+ true
60
+ end
61
+
57
62
  # @return [Vedeu::Null::Geometry]
58
63
  def store
59
64
  self
@@ -26,6 +26,11 @@ module Vedeu
26
26
  }
27
27
  end
28
28
 
29
+ # @return [Boolean]
30
+ def null?
31
+ true
32
+ end
33
+
29
34
  # The null interface should not have a parent.
30
35
  #
31
36
  # @return [NilClass]
@@ -1,2 +1,12 @@
1
+ module Vedeu
2
+
3
+ # Provides the mechanisms to clear an interface or group of interfaces.
4
+ #
5
+ # @api private
6
+ module Clear
7
+ end # Clear
8
+
9
+ end # Vedeu
10
+
1
11
  require_relative 'named_group'
2
12
  require_relative 'named_interface'
@@ -60,38 +60,22 @@ module Vedeu
60
60
  # @return [Array<Array<Vedeu::Char>>]
61
61
  def output
62
62
  Vedeu.timer("Clearing: #{name}") do
63
- @clear ||= Array.new(height) do |iy|
64
- Array.new(width) do |ix|
63
+ @y = geometry.y
64
+ @x = geometry.x
65
+ @width = geometry.width
66
+ @height = geometry.height
67
+ @colour = interface.colour
68
+
69
+ @clear ||= Array.new(@width) do |iy|
70
+ Array.new(@height) do |ix|
65
71
  Vedeu::Char.new(value: ' ',
66
- colour: colour,
67
- position: Vedeu::Position[y + iy, x + ix])
72
+ colour: @colour,
73
+ position: [@y + iy, @x + ix])
68
74
  end
69
75
  end
70
76
  end
71
77
  end
72
78
 
73
- def colour
74
- @colour ||= interface.colour
75
- end
76
-
77
- def height
78
- @height ||= geometry.height
79
- end
80
-
81
- def width
82
- @width ||= geometry.width
83
- end
84
-
85
- # @return [Fixnum]
86
- def x
87
- @x ||= geometry.x
88
- end
89
-
90
- # @return [Fixnum]
91
- def y
92
- @y ||= geometry.y
93
- end
94
-
95
79
  end # NamedInterface
96
80
 
97
81
  end # Clear
@@ -37,9 +37,6 @@ module Vedeu
37
37
  :y,
38
38
  :yn
39
39
 
40
- def_delegators :interface,
41
- :visible?
42
-
43
40
  # @return [Array<Array<Vedeu::Char>>]
44
41
  # @see Vedeu::RenderBorder#initialize
45
42
  def self.with(border)
@@ -56,15 +53,13 @@ module Vedeu
56
53
 
57
54
  # @return [Array<Array<Vedeu::Char>>]
58
55
  def render
59
- return [] unless visible?
56
+ return [] unless interface.visible?
60
57
  return [] unless enabled?
61
58
 
62
59
  Vedeu.timer("Rendering border: #{name}") do
63
60
  out = [top, bottom]
64
61
 
65
- height.times do |y|
66
- out << [left(y), right(y)]
67
- end
62
+ height.times { |y| out << [left(y), right(y)] }
68
63
 
69
64
  out.flatten
70
65
  end
@@ -88,15 +83,10 @@ module Vedeu
88
83
  parent: interface,
89
84
  colour: colour,
90
85
  style: style,
91
- position: Vedeu::Position[iy, ix],
86
+ position: [iy, ix],
92
87
  border: type)
93
88
  end
94
89
 
95
- # @return [Array<Vedeu::Char>]
96
- def build_bottom_horizontal
97
- horizontal_border(:bottom_horizontal, yn)
98
- end
99
-
100
90
  # @return [Vedeu::Char]
101
91
  def build_bottom_left
102
92
  build(bottom_left, :bottom_left, *[yn, x]) if left?
@@ -107,11 +97,6 @@ module Vedeu
107
97
  build(bottom_right, :bottom_right, *[yn, xn]) if right?
108
98
  end
109
99
 
110
- # @return [Array<Vedeu::Char>]
111
- def build_top_horizontal
112
- horizontal_border(:top_horizontal, y)
113
- end
114
-
115
100
  # @return [Vedeu::Char]
116
101
  def build_top_left
117
102
  build(top_left, :top_left, *[y, x]) if left?
@@ -128,7 +113,11 @@ module Vedeu
128
113
  def bottom
129
114
  return [] unless bottom?
130
115
 
131
- [build_bottom_left, build_bottom_horizontal, build_bottom_right].compact
116
+ [
117
+ build_bottom_left,
118
+ build_horizontal(:bottom_horizontal, yn),
119
+ build_bottom_right,
120
+ ].compact
132
121
  end
133
122
 
134
123
  # @return [Vedeu::Geometry]
@@ -137,10 +126,11 @@ module Vedeu
137
126
  end
138
127
 
139
128
  # @param position [Symbol] Either :top_horizontal, or :bottom_horizontal.
129
+ # @param y_coordinate [Fixnum] The value of either y or yn.
140
130
  # @return [Array<Vedeu::Char>]
141
- def horizontal_border(position, y_coordinate)
142
- width.times.each_with_object([]) do |ix, a|
143
- a << build(horizontal, position, *[y_coordinate, (bx + ix)])
131
+ def build_horizontal(position, y_coordinate)
132
+ Array.new(width) do |ix|
133
+ build(horizontal, position, *[y_coordinate, (bx + ix)])
144
134
  end
145
135
  end
146
136
 
@@ -162,22 +152,6 @@ module Vedeu
162
152
  build(vertical, :left_vertical, *[(by + iy), x])
163
153
  end
164
154
 
165
- # Pads the title with a single whitespace either side.
166
- #
167
- # @example
168
- # title = 'Truncated!'
169
- # width = 20
170
- # # => ' Truncated! '
171
- #
172
- # width = 10
173
- # # => ' Trunca '
174
- #
175
- # @return [String]
176
- # @see #truncated_title
177
- def padded_title
178
- truncated_title.center(truncated_title.size + 2)
179
- end
180
-
181
155
  # Renders the right border for the interface.
182
156
  #
183
157
  # @param iy [Fixnum]
@@ -188,19 +162,18 @@ module Vedeu
188
162
  build(vertical, :right_vertical, *[(by + iy), xn])
189
163
  end
190
164
 
191
- # Return boolean indicating whether this border has a non-empty title.
165
+ # Renders the top border for the interface.
192
166
  #
193
- # @return [Boolean]
194
- def title?
195
- present?(title)
196
- end
197
-
198
- # Return boolean indicating whether the title fits within the width of the
199
- # top border.
167
+ # @note
168
+ # If a title has been specified, then the top border will include this
169
+ # title unless the size of the interface is smaller than the padded title
170
+ # length.
200
171
  #
201
- # @return [Boolean]
202
- def title_fits?
203
- width > title_characters.size
172
+ # @return [String]
173
+ def top
174
+ return [] unless top?
175
+
176
+ [build_top_left, titlebar, build_top_right].compact
204
177
  end
205
178
 
206
179
  # From the second element of {#title_characters} remove the border from each
@@ -208,9 +181,9 @@ module Vedeu
208
181
  #
209
182
  # @return [Array<Vedeu::Char>]
210
183
  def titlebar
211
- return build_top_horizontal unless title? && title_fits?
184
+ return build_horizontal(:top_horizontal, y) unless title? && title_fits?
212
185
 
213
- build_top_horizontal.each_with_index do |char, index|
186
+ build_horizontal(:top_horizontal, y).each_with_index do |char, index|
214
187
  if index >= 1 && index <= title_characters.size
215
188
  char.border = nil
216
189
  char.value = title_characters[(index - 1)]
@@ -218,23 +191,40 @@ module Vedeu
218
191
  end
219
192
  end
220
193
 
194
+ # Return boolean indicating whether this border has a non-empty title.
195
+ #
196
+ # @return [Boolean]
197
+ def title?
198
+ present?(title)
199
+ end
200
+
201
+ # Return boolean indicating whether the title fits within the width of the
202
+ # top border.
203
+ #
204
+ # @return [Boolean]
205
+ def title_fits?
206
+ width > title_characters.size
207
+ end
208
+
221
209
  # @return [Array<String>]
222
210
  def title_characters
223
- @title_characters ||= padded_title.chars
211
+ @title_characters ||= title_padded.chars
224
212
  end
225
213
 
226
- # Renders the top border for the interface.
214
+ # Pads the title with a single whitespace either side.
227
215
  #
228
- # @note
229
- # If a title has been specified, then the top border will include this
230
- # title unless the size of the interface is smaller than the padded title
231
- # length.
216
+ # @example
217
+ # title = 'Truncated!'
218
+ # width = 20
219
+ # # => ' Truncated! '
220
+ #
221
+ # width = 10
222
+ # # => ' Trunca '
232
223
  #
233
224
  # @return [String]
234
- def top
235
- return [] unless top?
236
-
237
- [build_top_left, titlebar, build_top_right].compact
225
+ # @see #truncated_title
226
+ def title_padded
227
+ truncated_title.center(truncated_title.size + 2)
238
228
  end
239
229
 
240
230
  # Truncates the title to the width of the interface, minus characters needed
@@ -41,4 +41,3 @@ require_relative 'collections/all'
41
41
  require_relative 'model'
42
42
  require_relative 'repositories/all'
43
43
  require_relative 'repository'
44
-
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.4.48'
4
+ VERSION = '0.4.49'
5
5
 
6
6
  end
@@ -19,6 +19,7 @@ module Vedeu
19
19
  it { Vedeu.must_respond_to(:renders) }
20
20
  it { Vedeu.must_respond_to(:views) }
21
21
  it { Vedeu.must_respond_to(:bind) }
22
+ it { Vedeu.must_respond_to(:bound?) }
22
23
  it { Vedeu.must_respond_to(:unbind) }
23
24
  it { Vedeu.must_respond_to(:events) }
24
25
  it { Vedeu.must_respond_to(:focus) }
@@ -5,34 +5,34 @@ module Vedeu
5
5
  describe Bindings do
6
6
 
7
7
  context 'the system events needed by Vedeu to run are defined' do
8
- it { Vedeu.events.registered?(:_clear_).must_equal(true) }
9
- it { Vedeu.events.registered?(:_clear_group_).must_equal(true) }
10
- it { Vedeu.events.registered?(:_cleanup_).must_equal(true) }
11
- it { Vedeu.events.registered?(:_command_).must_equal(true) }
12
- it { Vedeu.events.registered?(:_exit_).must_equal(true) }
13
- it { Vedeu.events.registered?(:_initialize_).must_equal(true) }
14
- it { Vedeu.events.registered?(:_keypress_).must_equal(true) }
15
- it { Vedeu.events.registered?(:_log_).must_equal(true) }
16
- it { Vedeu.events.registered?(:_mode_switch_).must_equal(true) }
17
- it { Vedeu.events.registered?(:_refresh_).must_equal(true) }
18
- it { Vedeu.events.registered?(:_refresh_cursor_).must_equal(true) }
19
- it { Vedeu.events.registered?(:_refresh_group_).must_equal(true) }
20
- it { Vedeu.events.registered?(:_resize_).must_equal(true) }
8
+ it { Vedeu.bound?(:_clear_).must_equal(true) }
9
+ it { Vedeu.bound?(:_clear_group_).must_equal(true) }
10
+ it { Vedeu.bound?(:_cleanup_).must_equal(true) }
11
+ it { Vedeu.bound?(:_command_).must_equal(true) }
12
+ it { Vedeu.bound?(:_exit_).must_equal(true) }
13
+ it { Vedeu.bound?(:_initialize_).must_equal(true) }
14
+ it { Vedeu.bound?(:_keypress_).must_equal(true) }
15
+ it { Vedeu.bound?(:_log_).must_equal(true) }
16
+ it { Vedeu.bound?(:_mode_switch_).must_equal(true) }
17
+ it { Vedeu.bound?(:_refresh_).must_equal(true) }
18
+ it { Vedeu.bound?(:_refresh_cursor_).must_equal(true) }
19
+ it { Vedeu.bound?(:_refresh_group_).must_equal(true) }
20
+ it { Vedeu.bound?(:_resize_).must_equal(true) }
21
21
  end
22
22
 
23
23
  context 'the geometry specific events are defined' do
24
- it { Vedeu.events.registered?(:_maximise_).must_equal(true) }
25
- it { Vedeu.events.registered?(:_unmaximise_).must_equal(true) }
24
+ it { Vedeu.bound?(:_maximise_).must_equal(true) }
25
+ it { Vedeu.bound?(:_unmaximise_).must_equal(true) }
26
26
  end
27
27
 
28
28
  context 'the focus specific events are defined' do
29
- it { Vedeu.events.registered?(:_focus_by_name_).must_equal(true) }
30
- it { Vedeu.events.registered?(:_focus_next_).must_equal(true) }
31
- it { Vedeu.events.registered?(:_focus_prev_).must_equal(true) }
29
+ it { Vedeu.bound?(:_focus_by_name_).must_equal(true) }
30
+ it { Vedeu.bound?(:_focus_next_).must_equal(true) }
31
+ it { Vedeu.bound?(:_focus_prev_).must_equal(true) }
32
32
  end
33
33
 
34
34
  context 'the refresh event for all registered interfaces is defined' do
35
- it { Vedeu.events.registered?(:_refresh_).must_equal(true) }
35
+ it { Vedeu.bound?(:_refresh_).must_equal(true) }
36
36
  end
37
37
 
38
38
  end # Bindings
@@ -7,13 +7,13 @@ module Vedeu
7
7
  describe DRB do
8
8
 
9
9
  context 'the drb specific events are defined' do
10
- it { Vedeu.events.registered?(:_drb_input_).must_equal(true) }
11
- it { Vedeu.events.registered?(:_drb_retrieve_output_).must_equal(true) }
12
- it { Vedeu.events.registered?(:_drb_store_output_).must_equal(true) }
13
- it { Vedeu.events.registered?(:_drb_restart_).must_equal(true) }
14
- it { Vedeu.events.registered?(:_drb_start_).must_equal(true) }
15
- it { Vedeu.events.registered?(:_drb_status_).must_equal(true) }
16
- it { Vedeu.events.registered?(:_drb_stop_).must_equal(true) }
10
+ it { Vedeu.bound?(:_drb_input_).must_equal(true) }
11
+ it { Vedeu.bound?(:_drb_retrieve_output_).must_equal(true) }
12
+ it { Vedeu.bound?(:_drb_store_output_).must_equal(true) }
13
+ it { Vedeu.bound?(:_drb_restart_).must_equal(true) }
14
+ it { Vedeu.bound?(:_drb_start_).must_equal(true) }
15
+ it { Vedeu.bound?(:_drb_status_).must_equal(true) }
16
+ it { Vedeu.bound?(:_drb_stop_).must_equal(true) }
17
17
  end
18
18
 
19
19
  end # DRB
@@ -7,16 +7,16 @@ module Vedeu
7
7
  describe Menus do
8
8
 
9
9
  context 'the menu specific events are defined' do
10
- it { Vedeu.events.registered?(:_menu_bottom_).must_equal(true) }
11
- it { Vedeu.events.registered?(:_menu_current_).must_equal(true) }
12
- it { Vedeu.events.registered?(:_menu_deselect_).must_equal(true) }
13
- it { Vedeu.events.registered?(:_menu_items_).must_equal(true) }
14
- it { Vedeu.events.registered?(:_menu_next_).must_equal(true) }
15
- it { Vedeu.events.registered?(:_menu_prev_).must_equal(true) }
16
- it { Vedeu.events.registered?(:_menu_selected_).must_equal(true) }
17
- it { Vedeu.events.registered?(:_menu_select_).must_equal(true) }
18
- it { Vedeu.events.registered?(:_menu_top_).must_equal(true) }
19
- it { Vedeu.events.registered?(:_menu_view_).must_equal(true) }
10
+ it { Vedeu.bound?(:_menu_bottom_).must_equal(true) }
11
+ it { Vedeu.bound?(:_menu_current_).must_equal(true) }
12
+ it { Vedeu.bound?(:_menu_deselect_).must_equal(true) }
13
+ it { Vedeu.bound?(:_menu_items_).must_equal(true) }
14
+ it { Vedeu.bound?(:_menu_next_).must_equal(true) }
15
+ it { Vedeu.bound?(:_menu_prev_).must_equal(true) }
16
+ it { Vedeu.bound?(:_menu_selected_).must_equal(true) }
17
+ it { Vedeu.bound?(:_menu_select_).must_equal(true) }
18
+ it { Vedeu.bound?(:_menu_top_).must_equal(true) }
19
+ it { Vedeu.bound?(:_menu_view_).must_equal(true) }
20
20
  end
21
21
 
22
22
  end # Menus
@@ -7,19 +7,19 @@ module Vedeu
7
7
  describe Movement do
8
8
 
9
9
  context 'the movement events are defined' do
10
- it { Vedeu.events.registered?(:_cursor_down_).must_equal(true) }
11
- it { Vedeu.events.registered?(:_cursor_left_).must_equal(true) }
12
- it { Vedeu.events.registered?(:_cursor_origin_).must_equal(true) }
13
- it { Vedeu.events.registered?(:_cursor_position_).must_equal(true) }
14
- it { Vedeu.events.registered?(:_cursor_reposition_).must_equal(true) }
15
- it { Vedeu.events.registered?(:_cursor_reset_).must_equal(true) }
16
- it { Vedeu.events.registered?(:_cursor_right_).must_equal(true) }
17
- it { Vedeu.events.registered?(:_cursor_up_).must_equal(true) }
18
-
19
- it { Vedeu.events.registered?(:_geometry_down_).must_equal(true) }
20
- it { Vedeu.events.registered?(:_geometry_left_).must_equal(true) }
21
- it { Vedeu.events.registered?(:_geometry_right_).must_equal(true) }
22
- it { Vedeu.events.registered?(:_geometry_up_).must_equal(true) }
10
+ it { Vedeu.bound?(:_cursor_down_).must_equal(true) }
11
+ it { Vedeu.bound?(:_cursor_left_).must_equal(true) }
12
+ it { Vedeu.bound?(:_cursor_origin_).must_equal(true) }
13
+ it { Vedeu.bound?(:_cursor_position_).must_equal(true) }
14
+ it { Vedeu.bound?(:_cursor_reposition_).must_equal(true) }
15
+ it { Vedeu.bound?(:_cursor_reset_).must_equal(true) }
16
+ it { Vedeu.bound?(:_cursor_right_).must_equal(true) }
17
+ it { Vedeu.bound?(:_cursor_up_).must_equal(true) }
18
+
19
+ it { Vedeu.bound?(:_geometry_down_).must_equal(true) }
20
+ it { Vedeu.bound?(:_geometry_left_).must_equal(true) }
21
+ it { Vedeu.bound?(:_geometry_right_).must_equal(true) }
22
+ it { Vedeu.bound?(:_geometry_up_).must_equal(true) }
23
23
  end
24
24
 
25
25
  end # Movement
@@ -7,17 +7,17 @@ module Vedeu
7
7
  describe Visibility do
8
8
 
9
9
  context 'the visibility events are defined' do
10
- it { Vedeu.events.registered?(:_cursor_hide_).must_equal(true) }
11
- it { Vedeu.events.registered?(:_cursor_show_).must_equal(true) }
12
- it { Vedeu.events.registered?(:_hide_cursor_).must_equal(true) }
13
- it { Vedeu.events.registered?(:_show_cursor_).must_equal(true) }
10
+ it { Vedeu.bound?(:_cursor_hide_).must_equal(true) }
11
+ it { Vedeu.bound?(:_cursor_show_).must_equal(true) }
12
+ it { Vedeu.bound?(:_hide_cursor_).must_equal(true) }
13
+ it { Vedeu.bound?(:_show_cursor_).must_equal(true) }
14
14
 
15
- it { Vedeu.events.registered?(:_hide_group_).must_equal(true) }
16
- it { Vedeu.events.registered?(:_show_group_).must_equal(true) }
15
+ it { Vedeu.bound?(:_hide_group_).must_equal(true) }
16
+ it { Vedeu.bound?(:_show_group_).must_equal(true) }
17
17
 
18
- it { Vedeu.events.registered?(:_hide_interface_).must_equal(true) }
19
- it { Vedeu.events.registered?(:_show_interface_).must_equal(true) }
20
- it { Vedeu.events.registered?(:_toggle_interface_).must_equal(true) }
18
+ it { Vedeu.bound?(:_hide_interface_).must_equal(true) }
19
+ it { Vedeu.bound?(:_show_interface_).must_equal(true) }
20
+ it { Vedeu.bound?(:_toggle_interface_).must_equal(true) }
21
21
  end
22
22
 
23
23
  end # Visibility
@@ -17,6 +17,8 @@ module Vedeu
17
17
  # end
18
18
 
19
19
  describe '#duplicate' do
20
+ subject { model_instance.duplicate(_name) }
21
+
20
22
  context 'when the model exists' do
21
23
  # it { skip }
22
24
  end
@@ -18,6 +18,23 @@ module Vedeu
18
18
  it { subject.must_be_instance_of(TrueClass) }
19
19
  end
20
20
 
21
+ describe '.bound?' do
22
+ subject { described.bound?(event_name) }
23
+
24
+ context 'when the event is registered' do
25
+ before { Vedeu.bind(event_name) }
26
+ after { Vedeu.unbind(event_name) }
27
+
28
+ it { subject.must_equal(true) }
29
+ end
30
+
31
+ context 'when the event is not registered' do
32
+ before { Vedeu.unbind(event_name) }
33
+
34
+ it { subject.must_equal(false) }
35
+ end
36
+ end
37
+
21
38
  describe '.unbind' do
22
39
  it { described.must_respond_to(:unbind ) }
23
40
  end
@@ -61,6 +61,12 @@ module Vedeu
61
61
  it { subject.must_equal(7) }
62
62
  end
63
63
 
64
+ describe '#null?' do
65
+ subject { instance.null? }
66
+
67
+ it { subject.must_be_instance_of(TrueClass) }
68
+ end
69
+
64
70
  describe '#render' do
65
71
  subject { instance.render }
66
72
 
@@ -27,6 +27,12 @@ module Vedeu
27
27
  it { subject.must_be_instance_of(NilClass) }
28
28
  end
29
29
 
30
+ describe '#null?' do
31
+ subject { instance.null? }
32
+
33
+ it { subject.must_be_instance_of(TrueClass) }
34
+ end
35
+
30
36
  describe '#render' do
31
37
  subject { instance.render }
32
38
 
@@ -29,6 +29,12 @@ module Vedeu
29
29
  it { subject.must_be_instance_of(NilClass) }
30
30
  end
31
31
 
32
+ describe '#null?' do
33
+ subject { instance.null? }
34
+
35
+ it { subject.must_be_instance_of(TrueClass) }
36
+ end
37
+
32
38
  describe '#parent' do
33
39
  subject { instance.parent }
34
40
 
@@ -32,6 +32,12 @@ module Vedeu
32
32
  it { instance.must_respond_to(:name) }
33
33
  end
34
34
 
35
+ describe '#null?' do
36
+ subject { instance.null? }
37
+
38
+ it { subject.must_be_instance_of(TrueClass) }
39
+ end
40
+
35
41
  describe '#centred' do
36
42
  subject { instance.centred }
37
43
 
@@ -21,6 +21,12 @@ module Vedeu
21
21
  it { subject.must_be_instance_of(Hash) }
22
22
  end
23
23
 
24
+ describe '#null?' do
25
+ subject { instance.null? }
26
+
27
+ it { subject.must_be_instance_of(TrueClass) }
28
+ end
29
+
24
30
  describe '#parent' do
25
31
  subject { instance.parent }
26
32
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vedeu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.48
4
+ version: 0.4.49
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Laking
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-12 00:00:00.000000000 Z
11
+ date: 2015-07-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard