Skip to content
Browse files

Merge pull request #562 from joliss/launchy-version

Check Launchy version as suggested by @levity in #415
  • Loading branch information...
2 parents 812c4f3 + 53b5c2e commit 9ed30f08ca799f2a6dff4922ba231ed4d31e0898 @jnicklas committed Dec 9, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 lib/capybara/util/save_and_open_page.rb
View
5 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 9ed30f0

Please sign in to comment.
Something went wrong with that request. Please try again.