Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update to launchy-2.0 #415

Merged
merged 1 commit into from

4 participants

@copiousfreetime

I have updated launchy and the api that capybara was using is no longer in existence.

This pull requests should update capybara to the latest version of launchy and utilize the appropriate launchy api.

enjoy,

-jeremy

@joliss joliss closed this
@joliss joliss reopened this
@joliss joliss merged commit b0dbaf8 into jnicklas:master
@joliss
Collaborator

Merged -- thank you!

@krisleech

Is this in a release yet? I'm pinning to git head to prevent this error.

@joliss
Collaborator

Yes, it's in all recent Capybara releases.

@levity

Capybara should check that the version of Launchy is new enough; I was just running into a bug where save_and_open_page wasn't working because v0.4.0 doesn't support file URLs without "file:///". Not sure this should be a runtime check (i.e. Launchy::VERSION.split('.').first.to_i < 2) or if it would be acceptable to require Launchy ~> 2 as a non-development dependency.

@joliss joliss referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
@joliss joliss referenced this pull request from a commit in joliss/capybara
@joliss joliss 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.)
53b5c2e
@joliss
Collaborator

It's best not to require Launchy at runtime (to keep dependency proliferation in check), but I added a runtime check in #562.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 18, 2011
  1. @copiousfreetime

    Update to launchy-2.0

    copiousfreetime authored
This page is out of date. Refresh to see the latest.
View
2  capybara.gemspec
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
s.add_development_dependency("sinatra", [">= 0.9.4"])
s.add_development_dependency("rspec", [">= 2.0.0"])
- s.add_development_dependency("launchy", [">= 0.3.5"])
+ s.add_development_dependency("launchy", ["~> 2.0.2"])
s.add_development_dependency("yard", [">= 0.5.8"])
s.add_development_dependency("fuubar", [">= 0.0.1"])
s.add_development_dependency("cucumber", [">= 0.10"])
View
2  lib/capybara/util/save_and_open_page.rb
@@ -23,7 +23,7 @@ def save_and_open_page(html, file_name=nil)
def open_in_browser(path) # :nodoc
require "launchy"
- Launchy::Browser.run(path)
+ Launchy.open(path)
rescue LoadError
warn "Sorry, you need to install launchy (`gem install launchy`) and " <<
"make sure it's available to open pages with `save_and_open_page`."
View
2  spec/save_and_open_page_spec.rb
@@ -35,7 +35,7 @@
<html>
HTML
- Launchy::Browser.stub(:run)
+ Launchy.stub(:open)
end
def default_file_expectations
Something went wrong with that request. Please try again.