spec/ios/gestures_spec.rb in sugarcube-3.3.7 vs spec/ios/gestures_spec.rb in sugarcube-3.4.0
- old
+ new
@@ -67,17 +67,36 @@
end
gesture.should.be.kind_of(UIPanGestureRecognizer)
@view.gestureRecognizers.should.include?(gesture)
end
- it 'should work with options' do
+ it 'should work with fingers options' do
gesture = @view.on_pan(min_fingers: 2, max_fingers: 2) do |gesture|
end
gesture.should.be.kind_of(UIPanGestureRecognizer)
gesture.maximumNumberOfTouches.should == 2
gesture.minimumNumberOfTouches.should == 2
@view.gestureRecognizers.should.include?(gesture)
end
+
+ it 'should work with edges option' do
+ gesture = @view.on_pan(edges: [:top, :left]) do |gesture|
+ end
+ gesture.should.be.kind_of(UIScreenEdgePanGestureRecognizer)
+ gesture.edges.should == (:left.uirectedge + :top.uirectedge)
+ @view.gestureRecognizers.should.include?(gesture)
+ end
+
+ it 'should ignore :none edges option' do
+ gesture = @view.on_pan(edges: [:none], min_fingers: 2, max_fingers: 2) do |gesture|
+ end
+ gesture.should.be.kind_of(UIPanGestureRecognizer)
+ gesture.maximumNumberOfTouches.should == 2
+ gesture.minimumNumberOfTouches.should == 2
+ @view.gestureRecognizers.should.include?(gesture)
+ end
+
+
end
describe 'on_press' do
it 'should work' do
gesture = @view.on_press do |gesture|