File tree 3 files changed +28
-1
lines changed
3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ Release tags are https://github.com/appium/ruby_lib/releases .
7
7
### 1. Enhancements
8
8
9
9
### 2. Bug fixes
10
+ - Fix ` TypeError: superclass mismatch for class Test ` for minitest ` 5.11.0 ` + [ PR] ( https://github.com/appium/ruby_lib/pull/748 )
10
11
11
12
### 3. Deprecations
12
13
Original file line number Diff line number Diff line change @@ -12,6 +12,14 @@ def sauce?
12
12
ENV [ 'UPLOAD_FILE' ] && ENV [ 'SAUCE_USERNAME' ]
13
13
end
14
14
15
+ t 'left_greater_than_or_equal_to_right?' do
16
+ assert Minitest . left_greater_than_or_equal_to_right? '5.11.1' , '5.11.0'
17
+ assert Minitest . left_greater_than_or_equal_to_right? '5.11.0' , '5.11.0'
18
+ assert !Minitest . left_greater_than_or_equal_to_right? ( '5.10.1' , '5.11.0' )
19
+ assert !Minitest . left_greater_than_or_equal_to_right? ( '5.10.0' , '5.11.0' )
20
+ assert !Minitest . left_greater_than_or_equal_to_right? ( '4.10.0' , '5.11.0' )
21
+ end
22
+
15
23
t 'unicode defaults' do
16
24
data = File . read File . expand_path '../../../../data/unicode.txt' , __FILE__
17
25
data . strip . must_equal 174 . chr ( 'UTF-8' )
Original file line number Diff line number Diff line change @@ -3,7 +3,25 @@ module Minitest
3
3
# Fix superclass mismatch for class Spec
4
4
class Runnable
5
5
end
6
- class Test < Runnable
6
+
7
+ # To switch load class
8
+ def self . left_greater_than_or_equal_to_right? ( left , right )
9
+ left . split ( '.' ) . zip ( right . split ( '.' ) ) . each do |value |
10
+ diff = value [ 0 ] . to_i - value [ 1 ] . to_i
11
+ return true if diff > 0
12
+ return false if diff < 0
13
+ end
14
+ true
15
+ end
16
+
17
+ if left_greater_than_or_equal_to_right? ( VERSION , '5.11.0' )
18
+ # http://docs.seattlerb.org/minitest/History_rdoc.html#label-5.11.0+-2F+2018-01-01
19
+ # `Minitest::Test` became a subclass of `Minitest::Result`
20
+ class Test < Result
21
+ end
22
+ else
23
+ class Test < Runnable
24
+ end
7
25
end
8
26
class Spec < Test
9
27
end
You can’t perform that action at this time.
0 commit comments