Sha256: 50da8275c6e5b0ee8c8ecef7e08445eab4e2b88741a51c2bcf446c391b7f56a9

Contents?: true

Size: 809 Bytes

Versions: 5

Compression:

Stored size: 809 Bytes

Contents

require 'helper'

describe "Using fps actor", acceptance: true do
  it 'draws and updates the fps label' do
    game.stage do |stage| # instance of TestingStage
      @fps = create_actor :fps, font_name: 'arial', font_size: 20
    end

    game.should have_actor(:fps)
    game.should have_actor(:label)
    draw
    see_text_drawn "", in: arial_20

    Gosu.stubs(:fps).returns(99)
    draw
    see_text_drawn "", in: arial_20

    update 100
    draw
    see_text_drawn "99", in: arial_20

    remove_fps

    game.should_not have_actor(:fps)
    game.should_not have_actor(:label)

    pending "check color of drawn fonts"

  end

  let!(:arial_20) { mock_font('arial', 20) }

  def remove_fps
    game.current_stage.instance_variable_get("@fps").remove
    # TODO is this needed?
    update 1
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
gamebox-0.4.0.rc5 spec/acceptance/fps_actor_spec.rb
gamebox-0.4.0.rc4 spec/acceptance/fps_actor_spec.rb
gamebox-0.4.0.rc3 spec/acceptance/fps_actor_spec.rb
gamebox-0.4.0.rc2 spec/acceptance/fps_actor_spec.rb
gamebox-0.4.0.rc1 spec/acceptance/fps_actor_spec.rb