Permalink
Browse files

single_session support for RSpec 1.x

  • Loading branch information...
1 parent 06d176e commit 70820f454b398f70ad905faff1f0c1b22b30810d @epall epall committed Apr 5, 2011
Showing with 22 additions and 11 deletions.
  1. +21 −10 lib/sauce/integrations.rb
  2. +1 −1 sauce.gemspec
View
@@ -35,18 +35,29 @@ def execute(*args)
config = Sauce::Config.new
description = [self.class.description, self.description].join(" ")
config.browsers.each do |os, browser, version|
- if config.local?
- @selenium = ::Selenium::Client::Driver.new(:host => "127.0.0.1",
- :port => 4444,
- :browser => "*" + browser,
- :url => "http://127.0.0.1:#{config.local_application_port}/")
+ if config.single_session?
+ if config.local?
+ @selenium = Sauce.cached_session(:host => "127.0.0.1", :port => 4444, :browser => "*" +
+ browser, :url => "http://127.0.0.1:#{config.local_application_port}/")
+ else
+ @selenium = Sauce.cached_session({:os => os, :browser => browser, :browser_version => version,
+ :job_name => self.class.description})
+ end
+ super(*args)
else
- @selenium = Sauce::Selenium.new({:os => os, :browser => browser, :browser_version => version,
- :job_name => "#{description}"})
+ if config.local?
+ @selenium = ::Selenium::Client::Driver.new(:host => "127.0.0.1",
+ :port => 4444,
+ :browser => "*" + browser,
+ :url => "http://127.0.0.1:#{config.local_application_port}/")
+ else
+ @selenium = Sauce::Selenium.new({:os => os, :browser => browser, :browser_version => version,
+ :job_name => "#{description}"})
+ end
+ @selenium.start
+ super(*args)
+ @selenium.stop
end
- @selenium.start
- super(*args)
- @selenium.stop
end
end
View
@@ -2,7 +2,7 @@
Gem::Specification.new do |s|
s.name = %q{sauce}
- s.version = "0.19.1"
+ s.version = "0.20.0"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Eric Allen", "Sean Grove", "Steven Hazel"]

0 comments on commit 70820f4

Please sign in to comment.