android_tests/lib/android/specs/common/helper.rb in appium_lib-9.0.0 vs android_tests/lib/android/specs/common/helper.rb in appium_lib-9.1.0

- old
+ new

@@ -13,28 +13,28 @@ wait(wait_opts) { true } wait(wait_opts) { false } wait(wait_opts) { nil } # failed wait should error - proc { wait(wait_opts) { fail } }.must_raise Selenium::WebDriver::Error::TimeOutError + proc { wait(wait_opts) { raise } }.must_raise Selenium::WebDriver::Error::TimeOutError # regular rescue will not handle exceptions outside of StandardError hierarchy # must rescue Exception explicitly to rescue everything - proc { wait(wait_opts) { fail NoMemoryError } }.must_raise Selenium::WebDriver::Error::TimeOutError - proc { wait(timeout: 0.2, interval: 0.0) { fail NoMemoryError } }.must_raise Selenium::WebDriver::Error::TimeOutError + proc { wait(wait_opts) { raise NoMemoryError } }.must_raise Selenium::WebDriver::Error::TimeOutError + proc { wait(timeout: 0.2, interval: 0.0) { raise NoMemoryError } }.must_raise Selenium::WebDriver::Error::TimeOutError # invalid keys are rejected proc { wait(invalidkey: 2) { true } }.must_raise RuntimeError end t 'ignore' do # ignore should rescue all exceptions ignore { true } ignore { false } ignore { nil } - ignore { fail } - ignore { fail NoMemoryError } + ignore { raise } + ignore { raise NoMemoryError } end # wait_true is a success unless the value is not true t 'wait_true' do # successful wait should not error @@ -43,15 +43,15 @@ # failed wait should error proc { wait_true(wait_opts) { false } }.must_raise Selenium::WebDriver::Error::TimeOutError proc { wait_true(wait_opts) { nil } }.must_raise Selenium::WebDriver::Error::TimeOutError # raise should error - proc { wait_true(wait_opts) { fail } }.must_raise Selenium::WebDriver::Error::TimeOutError + proc { wait_true(wait_opts) { raise } }.must_raise Selenium::WebDriver::Error::TimeOutError # regular rescue will not handle exceptions outside of StandardError hierarchy # must rescue Exception explicitly to rescue everything - proc { wait_true(wait_opts) { fail NoMemoryError } }.must_raise Selenium::WebDriver::Error::TimeOutError - proc { wait_true(timeout: 0.2, interval: 0.0) { fail NoMemoryError } } + proc { wait_true(wait_opts) { raise NoMemoryError } }.must_raise Selenium::WebDriver::Error::TimeOutError + proc { wait_true(timeout: 0.2, interval: 0.0) { raise NoMemoryError } } .must_raise Selenium::WebDriver::Error::TimeOutError # invalid keys are rejected proc { wait_true(invalidkey: 2) { true } }.must_raise RuntimeError end