Sha256: 27c491fbf39770d0fa854cfa6de48b832044881dac83717d6f12210488fac747

Contents?: true

Size: 826 Bytes

Versions: 2

Compression:

Stored size: 826 Bytes

Contents

describe Joybox::Actions::Rotate do
  behaves_like "Action Sprite"

  it "should rotate the sprite by angle" do
    @sprite.run_action Rotate.by angle: 15
    @sprite.rotation = 5
    @sprite.rotation.should == 5

    wait 0.2 do
      @sprite.rotation.should.not == 5
      @sprite.rotation.should.not.be.close 15, 0.1
    end

    wait 0.4 do
      @sprite.rotation.should.not == 5
      @sprite.rotation.should.be.close 15, 0.1
    end
  end

  it "should rotate the sprite to angle" do
    @sprite.run_action Rotate.to angle: 15
    @sprite.rotation = 5
    @sprite.rotation.should == 5

    wait 0.2 do
      @sprite.rotation.should.not == 5
      @sprite.rotation.should.not.be.close 15, 0.1
    end

    wait 0.4 do
      @sprite.rotation.should.not == 5
      @sprite.rotation.should.be.close 15, 0.1
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
joybox-1.1.1 spec/motion/joybox/actions/rotate_spec.rb
joybox-1.1.0 spec/motion/joybox/actions/rotate_spec.rb