Class: MockGosuWindow

Inherits:
Object show all
Extended by:
Publisher
Includes:
GosuWindowAPI
Defined in:
lib/gamebox/spec/helper.rb

Constant Summary

Constants included from GosuWindowAPI

GosuWindowAPI::MAX_UPDATE_SIZE_IN_MILLIS

Instance Attribute Summary

Attributes included from GosuWindowAPI

#needs_cursor

Instance Method Summary collapse

Methods included from GosuWindowAPI

#button_down, #button_up, #draw

Constructor Details

#initializeMockGosuWindow

Returns a new instance of MockGosuWindow.



219
220
221
# File 'lib/gamebox/spec/helper.rb', line 219

def initialize
  @total_millis = 0
end

Instance Method Details

#caption=(new_caption) ⇒ Object



235
236
# File 'lib/gamebox/spec/helper.rb', line 235

def caption=(new_caption)
end

#rotate(*args) ⇒ Object



238
239
240
# File 'lib/gamebox/spec/helper.rb', line 238

def rotate(*args)
  yield
end

#update(millis) ⇒ Object



223
224
225
226
227
228
229
230
231
232
233
# File 'lib/gamebox/spec/helper.rb', line 223

def update(millis)
  if @total_millis == 0
    Gosu.stubs(:milliseconds).returns 0
    super()
  end
  @total_millis += millis
  Gosu.stubs(:milliseconds).returns @total_millis
  @first_update = false

  super()
end