spec/uiview_animation_spec.rb in sugarcube-0.18.12 vs spec/uiview_animation_spec.rb in sugarcube-0.18.16
- old
+ new
@@ -6,13 +6,21 @@
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
+ angle = 45.degrees
@view.rotate_to(angle)
current_angle = Math.atan2(@view.transform.b, @view.transform.a)
current_angle.should == angle
+ end
+
+ it 'should rotate 45 degrees and then 45 degrees again' do
+ angle = 45.degrees
+ @view.rotate_to(angle)
+ @view.rotate(angle)
+ current_angle = Math.atan2(@view.transform.b, @view.transform.a)
+ current_angle.should == 90.degrees
end
it 'should animate anything' do
UIView.animate {
@view.frame = [[0, 0], [0, 0]]