lib/calabash/android/gestures.rb in calabash-2.0.0.pre10 vs lib/calabash/android/gestures.rb in calabash-2.0.0.pre11

- old
+ new

@@ -312,59 +312,43 @@ @offset_y = offset[:y] end end # @!visibility private - def _pan_screen_up(options={}) + define_method(:_pan_screen_up) do |options={}| from = {x: 50, y: 90} to = {x: 50, y: 10} pan("* id:'content'", from, to, options) end # @!visibility private - def _pan_screen_down(options={}) + define_method(:_pan_screen_down) do |options={}| from = {x: 50, y: 10} to = {x: 50, y: 90} pan("* id:'content'", from, to, options) end # @!visibility private - def _flick_screen_up(options={}) + define_method(:_flick_screen_up) do |options={}| from = {x: 50, y: 90} to = {x: 50, y: 10} flick("* id:'content'", from, to, options) end # @!visibility private - def _flick_screen_down(options={}) + define_method(:_flick_screen_down) do |options={}| from = {x: 50, y: 10} to = {x: 50, y: 90} flick("* id:'content'", from, to, options) end # @!visibility private - def _pinch_screen(direction, options={}) - Device.default.pinch(direction, "* id:'content'", options) - end - - # @!visibility private - def _pinch_to_zoom(direction, query, options={}) - if direction == :out - Device.default.pinch(:in, query, options) - elsif direction == :in - Device.default.pinch(:out, query, options) - else - raise "Invalid direction '#{direction}'" - end - end - - # @!visibility private - def _pinch_screen_to_zoom(direction, options={}) - _pinch_to_zoom(direction, "* id:'content'", options) + define_method(:_pinch_screen) do |options={}| + Calabash::Internal.with_default_device(required_os: :android) {|device| device.pinch(direction, "* id:'content'", options)} end end end end