Sha256: 15feb234c74917e6c6ae243da4e9c7f2f358dd65cfa9e03a48821950785c6767

Contents?: true

Size: 1.16 KB

Versions: 2

Compression:

Stored size: 1.16 KB

Contents

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

  it "should scale the sprite by number" do
    @sprite.run_action Scale.by scale: 1.5
    @sprite.scaleX.should == 1.0
    @sprite.scaleY.should == 1.0

    wait 0.2 do
      @sprite.scaleX.should.not == 1.0
      @sprite.scaleY.should.not == 1.0
      @sprite.scaleX.should.not.be.close 1.5, 0.1
      @sprite.scaleY.should.not.be.close 1.5, 0.1
    end

    wait 0.4 do
      @sprite.scaleX.should.not == 1.0
      @sprite.scaleY.should.not == 1.0
      @sprite.scaleX.should.be.close 1.5, 0.1
      @sprite.scaleY.should.be.close 1.5, 0.1
    end
  end

  it "should scale the sprite to number" do
    @sprite.run_action Scale.to scale: 1.5
    @sprite.scaleX.should == 1.0
    @sprite.scaleY.should == 1.0

    wait 0.2 do
      @sprite.scaleX.should.not == 1.0
      @sprite.scaleY.should.not == 1.0
      @sprite.scaleX.should.not.be.close 1.5, 0.1
      @sprite.scaleY.should.not.be.close 1.5, 0.1
    end

    wait 0.4 do
      @sprite.scaleX.should.not == 1.0
      @sprite.scaleY.should.not == 1.0
      @sprite.scaleX.should.be.close 1.5, 0.1
      @sprite.scaleY.should.be.close 1.5, 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/scale_spec.rb
joybox-1.1.0 spec/motion/joybox/actions/scale_spec.rb