File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change 135
135
expect ( chromedriver . current_version . version ) . to eq ( '72.0.3626.7' )
136
136
end
137
137
end
138
+
139
+ context 'when using an Apple machine' do
140
+ before do
141
+ allow ( Webdrivers ::System ) . to receive ( :platform ) . and_return ( 'mac' )
142
+ allow ( Webdrivers ::System ) . to receive ( :download )
143
+ end
144
+
145
+ it 'uses the correct chromedriver filename suffix for Intel' do
146
+ allow ( Webdrivers ::System ) . to receive ( :apple_m1_architecture? ) . and_return ( false )
147
+ allow ( chromedriver ) . to receive ( :latest_version ) . and_return ( Gem ::Version . new ( '106.0.5249.61' ) )
148
+ chromedriver . required_version = nil
149
+
150
+ chromedriver . update
151
+ expect ( Webdrivers ::System ) . to have_received ( :download ) . with ( end_with ( '_mac64.zip' ) , anything )
152
+ end
153
+
154
+ it 'uses the correct chromedriver filename suffix from version 106.0.5249.61 for Silicon' do
155
+ allow ( Webdrivers ::System ) . to receive ( :apple_m1_architecture? ) . and_return ( true )
156
+ allow ( chromedriver ) . to receive ( :latest_version ) . and_return ( Gem ::Version . new ( '106.0.5249.61' ) )
157
+ chromedriver . required_version = nil
158
+
159
+ chromedriver . update
160
+ expect ( Webdrivers ::System ) . to have_received ( :download ) . with ( end_with ( '_arm64.zip' ) , anything )
161
+ end
162
+
163
+ it 'uses the correct chromedriver filename suffix for versions less than 106.0.5249.61 for Silicon' do
164
+ allow ( Webdrivers ::System ) . to receive ( :apple_m1_architecture? ) . and_return ( true )
165
+ allow ( chromedriver ) . to receive ( :latest_version ) . and_return ( Gem ::Version . new ( '106.0.5249.21' ) )
166
+ chromedriver . required_version = nil
167
+
168
+ chromedriver . update
169
+ expect ( Webdrivers ::System ) . to have_received ( :download ) . with ( end_with ( '_mac64_m1.zip' ) , anything )
170
+ end
171
+ end
138
172
end
139
173
140
174
describe '#current_version' do
You can’t perform that action at this time.
0 commit comments