Sha256: 4b1d4c7f549a090cc95dfa3f2b655c3f9aa1dfd2929dd1bee3f7aa1a6e1574bc

Contents?: true

Size: 421 Bytes

Versions: 8

Compression:

Stored size: 421 Bytes

Contents

describe "UIView animation methods" do
  before do
    @view = UIView.alloc.initWithFrame([[1,2],[3,4]])
  end

  it 'should delta_to x:1 y:2' do
    @view.delta_to([1,2]).frame.should == CGRectMake(2,4,3,4)
  end
  
  it 'should rotate 45 degrees' do
    angle = 45*Math::PI/180
    @view.rotate_to(angle)
    current_angle =  Math.atan2(@view.transform.b, @view.transform.a)
    current_angle.should == angle
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sugarcube-0.18.0 spec/uiview_animation_spec.rb
sugarcube-0.16.9 spec/uiview_animation_spec.rb
sugarcube-0.16.5 spec/uiview_animation_spec.rb
sugarcube-0.16.2 spec/uiview_animation_spec.rb
sugarcube-0.16 spec/uiview_animation_spec.rb
sugarcube-0.15.5 spec/uiview_animation_spec.rb
sugarcube-0.15.3 spec/uiview_animation_spec.rb
sugarcube-0.15.0 spec/uiview_animation_spec.rb