Skip to content

Commit

Permalink
Fix typos.
Browse files Browse the repository at this point in the history
  • Loading branch information
kapoorlakshya committed May 25, 2020
1 parent 23c03f2 commit 9698c30
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 16 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ variable. **Only set one to avoid confusion**.
##### Special exception for chromedriver and msedgedriver

Cache time will be respected as long as a driver binary exists and the major.minor.build versions of
the browser and the driver match. For example, if you update Chrome or Edge to v76 and its driver is
still at v75, `webdrivers` will ignore the cache time and update the driver to make sure you're
using a compatible version.
the browser and the driver match. For example, if you update Chrome or Edge to v76.0.123 and its driver is
still at v76.0.100, `webdrivers` will ignore the cache time and update the driver to make sure you're
using a compatible build version.

### Proxy

Expand Down
3 changes: 2 additions & 1 deletion lib/webdrivers/chromedriver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ def browser_build_version
end
alias chrome_build_version browser_build_version

# Returns true if a executable driver binary exists and its build version matches the browser build version
# Returns true if an executable driver binary exists
# and its build version matches the browser build version
def sufficient_binary?
super && current_version && (current_version < normalize_version('70.0.3538') ||
current_build_version == browser_build_version)
Expand Down
8 changes: 4 additions & 4 deletions spec/webdrivers/chromedriver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,11 @@
expect(File.exist?("#{Webdrivers::System.install_dir}/chromedriver.version")).to eq true
end

it 'does not make network call if cache is valid and driver exists' do
it 'does not make network calls if cache is valid and driver exists' do
allow(Webdrivers).to receive(:cache_time).and_return(3600)
Webdrivers::System.cache_version('chromedriver', '71.0.3578.137')
allow(chromedriver).to receive(:current_version).and_return(Gem::Version.new('71.0.3578.137'))
allow(chromedriver).to receive(:browser_version).and_return(Gem::Version.new('71.0.3578.137'))
allow(chromedriver).to receive(:current_version).and_return Gem::Version.new('71.0.3578.137')
allow(chromedriver).to receive(:browser_version).and_return Gem::Version.new('71.0.3578.137')
allow(Webdrivers::System).to receive(:exists?).and_return(true)
allow(Webdrivers::Network).to receive(:get)

Expand All @@ -213,7 +213,7 @@
expect(Webdrivers::Network).not_to have_received(:get)
end

it 'makes a network call if cache is expired' do
it 'makes network calls if cache is expired' do
Webdrivers::System.cache_version('chromedriver', '71.0.3578.137')
allow(chromedriver).to receive(:browser_version).and_return Gem::Version.new('71.0.3578.137')
allow(Webdrivers::Network).to receive(:get).and_return('73.0.3683.68')
Expand Down
12 changes: 6 additions & 6 deletions spec/webdrivers/edgedriver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@

it 'makes network calls if cached driver does not match the browser' do
Webdrivers::System.cache_version('msedgedriver', '71.0.3578.137')
allow(edgedriver).to receive(:current_version).and_return(Gem::Version.new('71.0.3578.137'))
allow(edgedriver).to receive(:browser_version).and_return(Gem::Version.new('73.0.3683.68'))
allow(edgedriver).to receive(:current_version).and_return Gem::Version.new('71.0.3578.137')
allow(edgedriver).to receive(:browser_version).and_return Gem::Version.new('73.0.3683.68')
allow(Webdrivers::Network).to receive(:get).and_return('73.0.3683.68'.encode('UTF-16'))
allow(Webdrivers::System).to receive(:download)

Expand Down Expand Up @@ -204,11 +204,11 @@
expect(File.exist?("#{Webdrivers::System.install_dir}/msedgedriver.version")).to eq true
end

it 'does not make network call if cache is valid and driver exists' do
it 'does not make network calls if cache is valid and driver exists' do
allow(Webdrivers).to receive(:cache_time).and_return(3600)
Webdrivers::System.cache_version('msedgedriver', '82.0.445.0')
allow(edgedriver).to receive(:current_version).and_return(Gem::Version.new('82.0.445.0'))
allow(edgedriver).to receive(:browser_version).and_return(Gem::Version.new('82.0.445.0'))
allow(edgedriver).to receive(:current_version).and_return Gem::Version.new('82.0.445.0')
allow(edgedriver).to receive(:browser_version).and_return Gem::Version.new('82.0.445.0')
allow(Webdrivers::System).to receive(:exists?).and_return(true)
allow(Webdrivers::Network).to receive(:get)

Expand All @@ -217,7 +217,7 @@
expect(Webdrivers::Network).not_to have_received(:get)
end

it 'makes a network call if cache is expired' do
it 'makes network calls if cache is expired' do
Webdrivers::System.cache_version('msedgedriver', '71.0.3578.137')
allow(Webdrivers::Network).to receive(:get).and_return('77.0.207.0'.encode('UTF-16'))
allow(Webdrivers::System).to receive(:valid_cache?).and_return(false)
Expand Down
2 changes: 1 addition & 1 deletion spec/webdrivers/geckodriver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
expect(File.exist?("#{Webdrivers::System.install_dir}/geckodriver.version")).to eq true
end

it 'does not make network call if cache is valid and driver exists' do
it 'does not make network calls if cache is valid and driver exists' do
allow(Webdrivers).to receive(:cache_time).and_return(3600)
Webdrivers::System.cache_version('geckodriver', '0.23.0')
allow(Webdrivers::System).to receive(:exists?).and_return(true)
Expand Down
2 changes: 1 addition & 1 deletion spec/webdrivers/i_edriver_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
expect(File.exist?("#{Webdrivers::System.install_dir}/IEDriverServer.version")).to eq true
end

it 'does not make network call if cache is valid and driver exists' do
it 'does not make network calls if cache is valid and driver exists' do
allow(Webdrivers).to receive(:cache_time).and_return(3600)
Webdrivers::System.cache_version('IEDriverServer', '3.4.0')
allow(Webdrivers::System).to receive(:exists?).and_return(true)
Expand Down

0 comments on commit 9698c30

Please sign in to comment.