Skip to content

Commit 25333d6

Browse files
Fix for Minitest 5
1 parent 1e047b0 commit 25333d6

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/appium_lib/driver.rb

+8-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,10 @@ def update data, *args
8181

8282
# Fix uninitialized constant Minitest (NameError)
8383
module Minitest
84-
class Spec; end
84+
# Fix superclass mismatch for class Spec
85+
class Runnable; end
86+
class Test < Runnable; end
87+
class Spec < Test; end
8588
end
8689

8790
module Appium
@@ -227,7 +230,10 @@ def initialize opts={}
227230
# prefer existing method.
228231
# super will invoke method missing on driver
229232
super(*args, &block)
230-
rescue NoMethodError
233+
# minitest also defines a name method,
234+
# so rescue argument error
235+
# and call the name method on $driver
236+
rescue NoMethodError, ArgumentError
231237
# puts "[Object.class_eval] '#{m}' not on super"
232238
$driver.send m, *args, &block if $driver.respond_to?(m)
233239
end

0 commit comments

Comments
 (0)