Permalink
Browse files

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.)
  • Loading branch information...
joliss committed Dec 8, 2011
1 parent 812c4f3 commit 53b5c2e62e1caf459da6982bc1fcc650cfd4bfec
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/capybara/util/save_and_open_page.rb
@@ -22,10 +22,11 @@ def save_and_open_page(html, file_name=nil)
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

0 comments on commit 53b5c2e

Please sign in to comment.