Check Launchy version as suggested by @levity in #415

Launchy versions older than 2.0.0 (like 0.4.0) are not compatible.
Capybara now complains if it finds such a Launchy version. (I tested all
of this.)
This commit is contained in:
Jo Liss 2011-12-09 00:10:04 +01:00
parent 812c4f3aba
commit 53b5c2e62e
1 changed files with 3 additions and 2 deletions

View File

@ -22,10 +22,11 @@ module Capybara
protected
def open_in_browser(path) # :nodoc
require "launchy"
require "launchy" # could raise LoadError
raise LoadError unless Launchy::Version::MAJOR >= 2
Launchy.open(path)
rescue LoadError
warn "Sorry, you need to install launchy (`gem install launchy`) and " <<
warn "Sorry, you need to install launchy >=2.0.0 (`gem install launchy`) and " <<
"make sure it's available to open pages with `save_and_open_page`."
end