Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

Commit

Permalink
pulling info from Capybara.app_host for users willing to test externa…
Browse files Browse the repository at this point in the history
…l apps
  • Loading branch information
santiycr committed Jul 25, 2011
1 parent aae55b9 commit 60466a1
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/sauce/capybara.rb
@@ -1,4 +1,7 @@
require 'capybara'
require 'uri'

$uri = URI.parse Capybara.app_host || ""

module Sauce
module Capybara
Expand All @@ -8,12 +11,13 @@ def browser
puts "[Connecting to Sauce OnDemand...]"
config = Sauce::Config.new
@domain = "#{rand(10000)}.test"
@sauce_tunnel = Sauce::Connect.new(:host => "127.0.0.1",
:port => rack_server.port,
@sauce_tunnel = Sauce::Connect.new(:host => $uri.host || rack_server.host,
:port => $uri.port || rack_server.port,
:domain => @domain,
:quiet => true)
@sauce_tunnel.wait_until_ready
@browser = Sauce::Selenium2.new(:name => "Capybara", :browser_url => "http://#{@domain}")
@browser = Sauce::Selenium2.new(:name => "Capybara test",
:browser_url => "http://#{@domain}")
at_exit do
@browser.quit
@sauce_tunnel.disconnect
Expand Down

0 comments on commit 60466a1

Please sign in to comment.