lib/appium_lib/driver.rb in appium_lib-0.5.7 vs lib/appium_lib/driver.rb in appium_lib-0.5.8

- old
+ new

@@ -189,10 +189,18 @@ @@loaded = true # Promote Appium driver methods to Object instance methods. $driver.public_methods(false).each do | m | Object.class_eval do define_method m do | *args, &block | - $driver.send m, *args, &block + begin + # puts "[Object.class_eval] Calling super for #{m}" + # prefer existing method. + # super will invoke method missing on driver + super(*args, &block) + rescue NoMethodError + # puts '[Object.class_eval] NoMethodError' + $driver.send m, *args, &block + end end end end end