File tree 2 files changed +24
-0
lines changed
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -168,8 +168,12 @@ def find_xcode_version(version)
168
168
169
169
seedlist . each do |current_seed |
170
170
return current_seed if current_seed . name == version
171
+ end
172
+
173
+ seedlist . each do |current_seed |
171
174
return current_seed if parsed_version && current_seed . version == parsed_version
172
175
end
176
+
173
177
nil
174
178
end
175
179
Original file line number Diff line number Diff line change @@ -98,4 +98,24 @@ module XcodeInstall
98
98
percentages . count . should . be . close ( 8 , 4 )
99
99
end
100
100
end
101
+
102
+ describe '#find_xcode_version' do
103
+ it 'should find the one with the matching name' do
104
+ installer = Installer . new
105
+
106
+ xcodes = [
107
+ XcodeInstall ::Xcode . new ( 'name' => '11.4 beta 2' ,
108
+ 'files' => [ {
109
+ 'remotePath' => '/Developer_Tools/Xcode_11.4_beta_2/Xcode_11.4_beta_2.xip'
110
+ } ] ) ,
111
+ XcodeInstall ::Xcode . new ( 'name' => '11.4' ,
112
+ 'files' => [ {
113
+ 'remotePath' => '/Developer_Tools/Xcode_11.4/Xcode_11.4.xip'
114
+ } ] )
115
+ ]
116
+
117
+ installer . stubs ( :fetch_seedlist ) . returns ( xcodes )
118
+ installer . find_xcode_version ( "11.4" ) . name . should . be . equal ( "11.4" )
119
+ end
120
+ end
101
121
end
You can’t perform that action at this time.
0 commit comments