vedeu 0.4.23 → 0.4.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/examples/cursor_app.rb +9 -4
  3. data/lib/vedeu/bindings.rb +36 -9
  4. data/lib/vedeu/cursor/move.rb +49 -55
  5. data/lib/vedeu/geometry/coordinate.rb +51 -38
  6. data/lib/vedeu/geometry/geometry.rb +44 -16
  7. data/lib/vedeu/geometry/position.rb +2 -6
  8. data/lib/vedeu/input/mapper.rb +2 -0
  9. data/lib/vedeu/models/char.rb +2 -2
  10. data/lib/vedeu/output/all.rb +1 -1
  11. data/lib/vedeu/output/border.rb +8 -6
  12. data/lib/vedeu/output/clear.rb +17 -19
  13. data/lib/vedeu/output/refresh.rb +4 -10
  14. data/lib/vedeu/output/renderers/all.rb +1 -2
  15. data/lib/vedeu/output/renderers/terminal.rb +3 -1
  16. data/lib/vedeu/output/viewport.rb +8 -8
  17. data/lib/vedeu/repositories/collections/all.rb +33 -6
  18. data/lib/vedeu/repositories/registerable.rb +21 -0
  19. data/lib/vedeu/repositories/repositories/borders.rb +2 -1
  20. data/lib/vedeu/repositories/repositories/buffers.rb +2 -1
  21. data/lib/vedeu/repositories/repositories/cursors.rb +1 -1
  22. data/lib/vedeu/repositories/repositories/events_repository.rb +1 -1
  23. data/lib/vedeu/repositories/repositories/geometries.rb +2 -1
  24. data/lib/vedeu/repositories/repositories/groups.rb +1 -1
  25. data/lib/vedeu/repositories/repositories/interfaces_repository.rb +2 -1
  26. data/lib/vedeu/repositories/repositories/keymaps.rb +1 -1
  27. data/lib/vedeu/repositories/repositories/menus.rb +1 -1
  28. data/lib/vedeu/repositories/repository.rb +1 -10
  29. data/lib/vedeu/support/log.rb +27 -13
  30. data/lib/vedeu/support/terminal.rb +1 -1
  31. data/lib/vedeu/support/timer.rb +11 -4
  32. data/test/lib/vedeu/cursor/move_test.rb +9 -7
  33. data/test/lib/vedeu/geometry/coordinate_test.rb +29 -21
  34. data/test/lib/vedeu/geometry/geometry_test.rb +14 -2
  35. data/test/lib/vedeu/repositories/collections/all_test.rb +71 -0
  36. data/vedeu.gemspec +2 -5
  37. metadata +6 -22
  38. data/lib/vedeu/repositories/collections/chars.rb +0 -8
  39. data/lib/vedeu/repositories/collections/events.rb +0 -8
  40. data/lib/vedeu/repositories/collections/interfaces.rb +0 -8
  41. data/lib/vedeu/repositories/collections/keys.rb +0 -8
  42. data/lib/vedeu/repositories/collections/lines.rb +0 -8
  43. data/lib/vedeu/repositories/collections/streams.rb +0 -8
  44. data/test/lib/vedeu/repositories/collections/chars_test.rb +0 -16
  45. data/test/lib/vedeu/repositories/collections/events_test.rb +0 -16
  46. data/test/lib/vedeu/repositories/collections/interfaces_test.rb +0 -16
  47. data/test/lib/vedeu/repositories/collections/keys_test.rb +0 -16
  48. data/test/lib/vedeu/repositories/collections/lines_test.rb +0 -16
  49. data/test/lib/vedeu/repositories/collections/streams_test.rb +0 -16
@@ -26,8 +26,7 @@ module Vedeu
26
26
  threads = storage.map do |renderer|
27
27
  Thread.new(renderer) do
28
28
  mutex.synchronize do
29
- Vedeu.log(type: :debug,
30
- message: "Rendering with: '#{renderer}' (#{storage.size} defined)")
29
+ Vedeu.log(type: :debug, message: "Rendering with: '#{renderer}'")
31
30
  renderer.render(*args)
32
31
  end
33
32
  end
@@ -35,7 +35,9 @@ module Vedeu
35
35
 
36
36
  # @return [String]
37
37
  def parsed
38
- Vedeu::Compressor.new(output).render
38
+ Vedeu::Timer.for(:debug, 'Compression') do
39
+ Vedeu::Compressor.new(output).render
40
+ end
39
41
  end
40
42
 
41
43
  end # Terminal
@@ -52,16 +52,16 @@ module Vedeu
52
52
  def render
53
53
  return [] unless visible?
54
54
 
55
- Vedeu.log(type: :output, message: "Rendering: '#{name}'")
56
-
57
- out = []
58
- show[0...height].each_with_index do |line, iy|
59
- line[0...width].each_with_index do |column, ix|
60
- column.position = Vedeu::IndexPosition[iy, ix, by, bx]
61
- out << column
55
+ Vedeu::Timer.for(:output, "Rendering: #{name}") do
56
+ out = []
57
+ show[0...height].each_with_index do |line, iy|
58
+ line[0...width].each_with_index do |column, ix|
59
+ column.position = Vedeu::IndexPosition[iy, ix, by, bx]
60
+ out << column
61
+ end
62
62
  end
63
+ out
63
64
  end
64
- out
65
65
  end
66
66
 
67
67
  # Returns a string representation of the viewport.
@@ -1,8 +1,35 @@
1
1
  require 'vedeu/repositories/collection'
2
2
 
3
- require_relative 'chars'
4
- require_relative 'events'
5
- require_relative 'interfaces'
6
- require_relative 'keys'
7
- require_relative 'lines'
8
- require_relative 'streams'
3
+ module Vedeu
4
+
5
+ # A collection of {Vedeu::Char} instances.
6
+ class Chars < Vedeu::Collection
7
+
8
+ end # Chars
9
+
10
+ # A collection of {Vedeu::Event} instances.
11
+ class Events < Vedeu::Collection
12
+
13
+ end # Events
14
+
15
+ # A collection of {Vedeu::Interface} instances.
16
+ class Interfaces < Vedeu::Collection
17
+
18
+ end # Interfaces
19
+
20
+ # A collection of {Vedeu::Key} instances.
21
+ class Keys < Vedeu::Collection
22
+
23
+ end # Keys
24
+
25
+ # A collection of {Vedeu::Line} instances.
26
+ class Lines < Vedeu::Collection
27
+
28
+ end # Lines
29
+
30
+ # A collection of {Vedeu::Stream} instances.
31
+ class Streams < Vedeu::Collection
32
+
33
+ end # Streams
34
+
35
+ end
@@ -7,12 +7,33 @@ module Vedeu
7
7
  # These class methods are mixed into the repository.
8
8
  module ClassMethods
9
9
 
10
+ # The null model is used when the repository cannot be found.
11
+ #
10
12
  # @param klass [Class]
11
13
  # @return [Symbol]
12
14
  def null(klass)
13
15
  define_method(:null_model) { klass }
14
16
  end
15
17
 
18
+ # The real model is the usual model to use for a given repository.
19
+ #
20
+ # @param klass [Class]
21
+ # @return [Symbol]
22
+ def real(klass)
23
+ define_method(:real_model) { klass }
24
+ end
25
+
26
+ # Register a repository for storing models.
27
+ #
28
+ # @param model [Class]
29
+ # @param storage [Class|Hash]
30
+ # @return [Vedeu::Repository]
31
+ def register(model = nil, storage = {})
32
+ new(model, storage).tap do |klass|
33
+ Vedeu::Repositories.register(klass.repository)
34
+ end
35
+ end
36
+
16
37
  end # ClassMethods
17
38
 
18
39
  # When this module is included in a class, provide ClassMethods as class
@@ -16,12 +16,13 @@ module Vedeu
16
16
  #
17
17
  # @return [Vedeu::Borders]
18
18
  def reset!
19
- @borders = Vedeu::Borders.register(Vedeu::Border)
19
+ @borders = register(Vedeu::Border)
20
20
  end
21
21
 
22
22
  end
23
23
 
24
24
  null Vedeu::Null::Border
25
+ # real Vedeu::Border
25
26
 
26
27
  end # Borders
27
28
 
@@ -15,12 +15,13 @@ module Vedeu
15
15
  #
16
16
  # @return [Vedeu::Buffers]
17
17
  def reset!
18
- @buffers = Vedeu::Buffers.register(Vedeu::Buffer)
18
+ @buffers = register(Vedeu::Buffer)
19
19
  end
20
20
 
21
21
  end
22
22
 
23
23
  null Vedeu::Null::Buffer
24
+ # real Vedeu::Buffer
24
25
 
25
26
  end # Buffers
26
27
 
@@ -20,7 +20,7 @@ module Vedeu
20
20
  #
21
21
  # @return [Vedeu::Cursors]
22
22
  def reset!
23
- @cursors = Vedeu::Cursors.register(Vedeu::Cursor)
23
+ @cursors = register(Vedeu::Cursor)
24
24
  end
25
25
 
26
26
  end
@@ -15,7 +15,7 @@ module Vedeu
15
15
  #
16
16
  # @return [Vedeu::EventsRepository]
17
17
  def reset!
18
- @events = Vedeu::EventsRepository.new(Vedeu::Events)
18
+ @events = new(Vedeu::Events)
19
19
  end
20
20
 
21
21
  end
@@ -16,12 +16,13 @@ module Vedeu
16
16
  #
17
17
  # @return [Vedeu::Geometries]
18
18
  def reset!
19
- @geometries = Vedeu::Geometries.register(Vedeu::Geometry)
19
+ @geometries = register(Vedeu::Geometry)
20
20
  end
21
21
 
22
22
  end
23
23
 
24
24
  null Vedeu::Null::Geometry
25
+ # real Vedeu::Geometry
25
26
 
26
27
  end # Geometries
27
28
 
@@ -15,7 +15,7 @@ module Vedeu
15
15
  #
16
16
  # @return [Vedeu::Groups]
17
17
  def reset!
18
- @groups = Vedeu::Groups.register(Vedeu::Group)
18
+ @groups = register(Vedeu::Group)
19
19
  end
20
20
 
21
21
  end
@@ -15,12 +15,13 @@ module Vedeu
15
15
  #
16
16
  # @return [Vedeu::InterfacesRepository]
17
17
  def reset!
18
- @interfaces = Vedeu::InterfacesRepository.register(Vedeu::Interface)
18
+ @interfaces = register(Vedeu::Interface)
19
19
  end
20
20
 
21
21
  end
22
22
 
23
23
  null Vedeu::Null::Interface
24
+ # real Vedeu::Interface
24
25
 
25
26
  end # InterfacesRepository
26
27
 
@@ -15,7 +15,7 @@ module Vedeu
15
15
  #
16
16
  # @return [Vedeu::Keymaps]
17
17
  def reset!
18
- @keymaps = Vedeu::Keymaps.register(Vedeu::Keymap)
18
+ @keymaps = register(Vedeu::Keymap)
19
19
  end
20
20
 
21
21
  end
@@ -15,7 +15,7 @@ module Vedeu
15
15
  #
16
16
  # @return [Vedeu::Menus]
17
17
  def reset!
18
- @menus = Vedeu::Menus.register(Vedeu::Menu)
18
+ @menus = register(Vedeu::Menu)
19
19
  end
20
20
 
21
21
  end
@@ -22,15 +22,6 @@ module Vedeu
22
22
  # @return [void]
23
23
  attr_reader :storage
24
24
 
25
- # @param model [Class]
26
- # @param storage [Class|Hash]
27
- # @return [Vedeu::Repository]
28
- def self.register(model = nil, storage = {})
29
- new(model, storage).tap do |klass|
30
- Vedeu::Repositories.register(klass.repository)
31
- end
32
- end
33
-
34
25
  # Returns a new instance of Vedeu::Repository.
35
26
  #
36
27
  # @param model [Class]
@@ -45,7 +36,7 @@ module Vedeu
45
36
  #
46
37
  # @return [Class]
47
38
  def repository
48
- self.class # .name
39
+ self.class
49
40
  end
50
41
 
51
42
  # @param name [String] The name of the stored model.
@@ -94,7 +94,8 @@ module Vedeu
94
94
  #
95
95
  # @return [TrueClass]
96
96
  def log(message:, force: false, type: :info)
97
- logger.debug([message_type(type), message]) if enabled? || force
97
+ logger.debug([message_type(type),
98
+ message_body(type, message)]) if enabled? || force
98
99
  end
99
100
 
100
101
  # @return [TrueClass]
@@ -108,6 +109,8 @@ module Vedeu
108
109
 
109
110
  private
110
111
 
112
+ # @param message [String]
113
+ # @param time [Time]
111
114
  # @return [String]
112
115
  def formatted_message(message, time = Time.now)
113
116
  [timestamp(time.utc.iso8601), message, "\n"].join
@@ -123,9 +126,19 @@ module Vedeu
123
126
  Vedeu::Configuration.log
124
127
  end
125
128
 
129
+ # @param type [Symbol] The type of log message.
130
+ # @param body [String] The log message itself.
131
+ # @return [String]
132
+ def message_body(type, body)
133
+ Vedeu::Esc.send(message_types.fetch(type, :default).last) do
134
+ body
135
+ end
136
+ end
137
+
138
+ # @param type [Symbol] The type of log message.
126
139
  # @return [String]
127
140
  def message_type(type)
128
- Vedeu::Esc.send(message_types.fetch(type, :default)) do
141
+ Vedeu::Esc.send(message_types.fetch(type, :default).first) do
129
142
  "[#{type}]".ljust(9)
130
143
  end
131
144
  end
@@ -133,23 +146,24 @@ module Vedeu
133
146
  # @return [Hash<Symbol => Symbol>]
134
147
  def message_types
135
148
  {
136
- config: :yellow,
137
- create: :green,
138
- debug: :red,
139
- drb: :blue,
140
- event: :magenta,
141
- info: :default,
142
- input: :yellow,
143
- output: :green,
144
- store: :cyan,
145
- test: :white,
146
- update: :cyan,
149
+ config: [:light_yellow, :yellow],
150
+ create: [:light_green, :green],
151
+ debug: [:light_red, :red],
152
+ drb: [:light_blue, :blue],
153
+ event: [:light_magenta, :magenta],
154
+ info: [:white, :default],
155
+ input: [:light_yellow, :yellow],
156
+ output: [:light_green, :green],
157
+ store: [:light_cyan, :cyan],
158
+ test: [:light_white, :white],
159
+ update: [:light_cyan, :cyan],
147
160
  }
148
161
  end
149
162
 
150
163
  # Returns a formatted (red, underlined) UTC timestamp,
151
164
  # eg. 2014-10-24T12:34:56Z
152
165
  #
166
+ # @param utc_time [String]
153
167
  # @return [String]
154
168
  def timestamp(utc_time)
155
169
  return '' if @last_seen == utc_time
@@ -37,7 +37,7 @@ module Vedeu
37
37
  #
38
38
  # @return [String]
39
39
  def input
40
- Vedeu.log(type: :debug, message: "--- Waiting for user input")
40
+ Vedeu.log(type: :debug, message: 'Waiting for user input...')
41
41
 
42
42
  keys_or_cmd = if raw_mode?
43
43
  keys = console.getch
@@ -3,16 +3,19 @@ module Vedeu
3
3
  # Measure the duration. Used for debugging.
4
4
  class Timer
5
5
 
6
+ # @param type [Symbol]
6
7
  # @param message [String]
7
8
  # @param block [Proc]
8
9
  # @return [void]
9
- def self.for(message = '', &block)
10
- new(message).measure(&block)
10
+ def self.for(type = :debug, message = '', &block)
11
+ new(type, message).measure(&block)
11
12
  end
12
13
 
14
+ # @param type [Symbol]
13
15
  # @param message [String]
14
16
  # @return [Vedeu::Timer]
15
- def initialize(message = '')
17
+ def initialize(type = :debug, message = '')
18
+ @type = type
16
19
  @message = message
17
20
  @started = Time.now.to_f
18
21
  end
@@ -24,7 +27,7 @@ module Vedeu
24
27
 
25
28
  elapsed = ((Time.now.to_f - started) * 1000).to_i
26
29
 
27
- Vedeu.log(type: :debug, message: "#{message} took #{elapsed}ms.")
30
+ Vedeu.log(type: type, message: "#{message} took #{elapsed}ms.")
28
31
 
29
32
  work
30
33
  end
@@ -39,6 +42,10 @@ module Vedeu
39
42
  # @return [String]
40
43
  attr_reader :message
41
44
 
45
+ # @!attribute [r] type
46
+ # @return [Symbol]
47
+ attr_reader :type
48
+
42
49
  end # Timer
43
50
 
44
51
  end # Vedeu
@@ -5,7 +5,8 @@ module Vedeu
5
5
  describe Move do
6
6
 
7
7
  let(:described) { Vedeu::Move }
8
- let(:instance) { described.new(_name, dy, dx) }
8
+ let(:instance) { described.new(entity, _name, dy, dx) }
9
+ let(:entity) { Vedeu::Cursor }
9
10
  let(:_name) { '' }
10
11
  let(:dy) { 0 }
11
12
  let(:dx) { 0 }
@@ -56,6 +57,7 @@ module Vedeu
56
57
 
57
58
  describe '#initialize' do
58
59
  it { instance.must_be_instance_of(described) }
60
+ it { instance.instance_variable_get('@entity').must_equal(entity) }
59
61
  it { instance.instance_variable_get('@name').must_equal(_name) }
60
62
  it { instance.instance_variable_get('@dy').must_equal(dy) }
61
63
  it { instance.instance_variable_get('@dx').must_equal(dx) }
@@ -69,7 +71,7 @@ module Vedeu
69
71
  Vedeu::Cursor.new(name: 'manganese', oy: 2, ox: 3, x: 8, y: 7).store
70
72
  end
71
73
 
72
- subject { described.by_name(direction, _name) }
74
+ subject { described.by_name(entity, direction, _name) }
73
75
 
74
76
  it { subject.must_be_instance_of(Vedeu::Cursor) }
75
77
 
@@ -107,7 +109,7 @@ module Vedeu
107
109
  describe '.down' do
108
110
  let(:_name) { 'move_down' }
109
111
 
110
- subject { described.down(_name) }
112
+ subject { described.down(entity, _name) }
111
113
 
112
114
  it { subject.must_be_instance_of(Vedeu::Cursor) }
113
115
 
@@ -135,7 +137,7 @@ module Vedeu
135
137
  describe '.left' do
136
138
  let(:_name) { 'move_left' }
137
139
 
138
- subject { described.left(_name) }
140
+ subject { described.left(entity, _name) }
139
141
 
140
142
  it { subject.must_be_instance_of(Vedeu::Cursor) }
141
143
 
@@ -161,7 +163,7 @@ module Vedeu
161
163
  describe '.right' do
162
164
  let(:_name) { 'move_right' }
163
165
 
164
- subject { described.right(_name) }
166
+ subject { described.right(entity, _name) }
165
167
 
166
168
  it { subject.must_be_instance_of(Vedeu::Cursor) }
167
169
 
@@ -189,7 +191,7 @@ module Vedeu
189
191
  describe '.up' do
190
192
  let(:_name) { 'move_up' }
191
193
 
192
- subject { described.up(_name) }
194
+ subject { described.up(entity, _name) }
193
195
 
194
196
  it { subject.must_be_instance_of(Vedeu::Cursor) }
195
197
 
@@ -215,7 +217,7 @@ module Vedeu
215
217
  describe '#origin' do
216
218
  let(:_name) { 'move_origin' }
217
219
 
218
- subject { described.origin(_name) }
220
+ subject { described.origin(entity, _name) }
219
221
 
220
222
  it { subject.must_be_instance_of(Vedeu::Cursor) }
221
223
 
@@ -5,18 +5,34 @@ module Vedeu
5
5
  describe Coordinate do
6
6
 
7
7
  let(:described) { Vedeu::Coordinate }
8
- let(:instance) { described.new(height, width, x, y) }
8
+ let(:instance) { described.new(_name) }
9
+ let(:_name) { 'coordinate' }
9
10
  let(:height) { 6 }
10
11
  let(:width) { 6 }
11
12
  let(:x) { 7 }
12
13
  let(:y) { 5 }
13
14
 
15
+ let(:borders) { mock('Vedeu::Borders') }
16
+ let(:border) {
17
+ Vedeu::Border.new({
18
+ name: _name,
19
+ enabled: true
20
+ })
21
+ }
22
+
23
+ before do
24
+ Vedeu::Geometry.new({name: _name,
25
+ height: height,
26
+ width: width,
27
+ x: x,
28
+ y: y}).store
29
+ Vedeu.stubs(:borders).returns(borders)
30
+ borders.stubs(:by_name).returns(border)
31
+ end
32
+
14
33
  describe '#initialize' do
15
34
  it { instance.must_be_instance_of(described) }
16
- it { instance.instance_variable_get('@height').must_equal(height) }
17
- it { instance.instance_variable_get('@width').must_equal(width) }
18
- it { instance.instance_variable_get('@x').must_equal(x) }
19
- it { instance.instance_variable_get('@y').must_equal(y) }
35
+ it { instance.instance_variable_get('@name').must_equal(_name) }
20
36
  end
21
37
 
22
38
  describe '#yn' do
@@ -29,7 +45,7 @@ module Vedeu
29
45
  end
30
46
 
31
47
  context 'when the height is > 0' do
32
- it { subject.must_equal(11) }
48
+ it { subject.must_equal(9) }
33
49
  end
34
50
  end
35
51
 
@@ -43,16 +59,12 @@ module Vedeu
43
59
  end
44
60
 
45
61
  context 'when the width is > 0' do
46
- it { subject.must_equal(13) }
62
+ it { subject.must_equal(11) }
47
63
  end
48
64
  end
49
65
 
50
66
  describe '#y_position' do
51
67
  let(:index) { 0 }
52
- let(:height) { 6 }
53
- let(:width) { 6 }
54
- let(:x) { 7 }
55
- let(:y) { 5 }
56
68
 
57
69
  subject { instance.y_position(index) }
58
70
 
@@ -61,18 +73,18 @@ module Vedeu
61
73
  context 'with a negative index' do
62
74
  let(:index) { -3 }
63
75
 
64
- it { subject.must_equal(5) }
76
+ it { subject.must_equal(6) }
65
77
  end
66
78
 
67
79
  context 'with an index greater than the maximum index for y' do
68
80
  let(:index) { 9 }
69
81
 
70
- it { subject.must_equal(11) }
82
+ it { subject.must_equal(9) }
71
83
 
72
84
  context 'but the height is negative' do
73
85
  let(:height) { -2 }
74
86
 
75
- it { subject.must_equal(0) }
87
+ it { subject.must_equal(1) }
76
88
  end
77
89
  end
78
90
 
@@ -85,10 +97,6 @@ module Vedeu
85
97
 
86
98
  describe '#x_position' do
87
99
  let(:index) { 0 }
88
- let(:height) { 6 }
89
- let(:width) { 6 }
90
- let(:x) { 7 }
91
- let(:y) { 5 }
92
100
 
93
101
  subject { instance.x_position(index) }
94
102
 
@@ -97,18 +105,18 @@ module Vedeu
97
105
  context 'with a negative index' do
98
106
  let(:index) { -3 }
99
107
 
100
- it { subject.must_equal(7) }
108
+ it { subject.must_equal(8) }
101
109
  end
102
110
 
103
111
  context 'with an index greater than the maximum index for x' do
104
112
  let(:index) { 9 }
105
113
 
106
- it { subject.must_equal(13) }
114
+ it { subject.must_equal(11) }
107
115
 
108
116
  context 'but the width is negative' do
109
117
  let(:width) { -2 }
110
118
 
111
- it { subject.must_equal(0) }
119
+ it { subject.must_equal(3) }
112
120
  end
113
121
  end
114
122
 
@@ -20,7 +20,7 @@ module Vedeu
20
20
  yn: yn,
21
21
  }
22
22
  }
23
- let(:centred) {}
23
+ let(:centred) { false }
24
24
  let(:height) {}
25
25
  let(:maximised) { false }
26
26
  let(:_name) {}
@@ -56,7 +56,10 @@ module Vedeu
56
56
 
57
57
  it { subject.must_be_instance_of(String) }
58
58
 
59
- it { subject.must_equal('<Vedeu::Geometry x:1 xn:40 y:1 yn:12 maximise:false>') }
59
+ it { subject.must_equal(
60
+ '<Vedeu::Geometry x:1 xn:40 y:1 yn:12 centred:false maximise:false>'
61
+ )
62
+ }
60
63
  end
61
64
 
62
65
  describe '#maximise' do
@@ -93,6 +96,15 @@ module Vedeu
93
96
  it { subject.maximised.must_equal(false) }
94
97
  end
95
98
 
99
+ describe '#move' do
100
+ let(:dy) {}
101
+ let(:dx) {}
102
+
103
+ subject { instance.move(dy, dx) }
104
+
105
+
106
+ end
107
+
96
108
  describe '#top, #right, #bottom, #left' do
97
109
  context 'maximised is true' do
98
110
  let(:attributes) { { maximised: true } }