lib/calabash/ios/device/rotation_mixin.rb in calabash-1.9.9.pre3 vs lib/calabash/ios/device/rotation_mixin.rb in calabash-2.0.0.pre1
- old
+ new
@@ -57,14 +57,14 @@
recording_name = "rotate_#{recording_name}"
playback_route(recording_name, form_factor)
end
# @!visibility private
- # Caller must pass position one of these positions down, left, right, up
+ # Caller must pass position one of these positions :down, :left, :right, :up
def rotate_home_button_to(position)
- valid_positions = ['down', 'left', 'right', 'up']
+ valid_positions = [:down, :left, :right, :up]
unless valid_positions.include?(position)
raise ArgumentError,
"Expected '#{position}' to be on of #{valid_positions.join(', ')}"
end
@@ -74,11 +74,11 @@
# available. It *might* make sense for the console to do this.
if defined?(IRB)
wait_for_server_to_start({:timeout => 1})
end
- orientation = status_bar_orientation
+ orientation = status_bar_orientation.to_sym
if orientation == position
return orientation
end
@@ -92,19 +92,21 @@
ROTATION_CANDIDATES.each do |recording_name|
playback_route(recording_name, form_factor)
# Wait for rotation animation.
- timeout = 1.0
- condition_route('NONE_ANIMATING', timeout, '*')
+ #
+ # Can't wait for animations because there might be animations other
+ # than rotation on the screen.
+ sleep(0.4)
- orientation = status_bar_orientation
+ orientation = status_bar_orientation.to_sym
if orientation == position
- return orientation
+ return orientation.to_s
end
end
- orientation
+ orientation.to_s
end
private
ROTATION_CANDIDATES =