Sha256: 9a0a5c09a84c504587a1665a7d34a6573bb2160eaf058ad7281b71700f5e8cc8

Contents?: true

Size: 776 Bytes

Versions: 8

Compression:

Stored size: 776 Bytes

Contents

require 'helper'

describe "Using fps actor", acceptance: true do

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

  it 'draws and updates the fps label' do
    game.stage do |stage|
      @fps = create_actor :fps, font_name: 'arial', font_size: 20, color: Color::RED
    end

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

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

    update 100
    draw
    see_text_drawn "99", in: arial_20, color: Color::RED

    remove_fps

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

  def remove_fps
    game.current_stage.instance_variable_get("@fps").remove
  end

end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
gamebox-0.5.5 spec/acceptance/fps_actor_spec.rb
gamebox-0.5.4 spec/acceptance/fps_actor_spec.rb
gamebox-0.5.2 spec/acceptance/fps_actor_spec.rb
gamebox-0.5.1 spec/acceptance/fps_actor_spec.rb
gamebox-0.5.0 spec/acceptance/fps_actor_spec.rb
gamebox-0.4.1 spec/acceptance/fps_actor_spec.rb
gamebox-0.4.0 spec/acceptance/fps_actor_spec.rb
gamebox-0.4.0.rc11 spec/acceptance/fps_actor_spec.rb