sauce 0.17.2 → 0.17.3.alpha1

Sign up to get free protection for your applications and to get access to all the features.
@@ -19,8 +19,10 @@ begin
19
19
  @@tunnel = Sauce::Connect.new(:host => config.application_host, :port => config.application_port || 80)
20
20
  @@tunnel.wait_until_ready
21
21
  end
22
- @@server = Sauce::Utilities::RailsServer.new
23
- @@server.start
22
+ if Sauce::Utilities::RailsServer.is_rails_app?
23
+ @@server = Sauce::Utilities::RailsServer.new
24
+ @@server.start
25
+ end
24
26
  end
25
27
  end
26
28
 
@@ -106,7 +108,8 @@ begin
106
108
  @@tunnel.wait_until_ready
107
109
  end
108
110
 
109
- if ::RSpec.configuration.settings[:files_to_run].any? {|file| file =~ /spec\/selenium\//}
111
+ if ::RSpec.configuration.settings[:files_to_run].any? {|file| file =~ /spec\/selenium\//} &&
112
+ Sauce::Utilities::RailsServer.is_rails_app?
110
113
  @@server = Sauce::Utilities::RailsServer.new
111
114
  @@server.start
112
115
  end
@@ -139,14 +142,20 @@ module Sauce
139
142
  unless my_name =~ /^default_test/
140
143
  config = Sauce::Config.new
141
144
  if config.application_host && !config.local?
142
- Sauce::Connect.ensure_connected(:host => config.application_host, :port => config.application_port || 80)
145
+ unless ENV['TEST_ENV_NUMBER'].to_i > 1
146
+ Sauce::Connect.ensure_connected(:host => config.application_host, :port => config.application_port || 80)
147
+ end
143
148
  end
144
149
 
145
150
  unless defined?(@@server)
146
- @@server = Sauce::Utilities::RailsServer.new
147
- @@server.start
148
- at_exit do
149
- @@server.stop
151
+ unless ENV['TEST_ENV_NUMBER'].to_i > 1
152
+ if Sauce::Utilities::RailsServer.is_rails_app?
153
+ @@server = Sauce::Utilities::RailsServer.new
154
+ @@server.start
155
+ at_exit do
156
+ @@server.stop
157
+ end
158
+ end
150
159
  end
151
160
  end
152
161
 
@@ -49,6 +49,11 @@ module Sauce
49
49
 
50
50
  class RailsServer
51
51
  include Sauce::Utilities
52
+
53
+ def self.is_rails_app?
54
+ File.exists?('script/server') || File.exists?('script/rails')
55
+ end
56
+
52
57
  def start
53
58
  STDERR.puts "Starting Rails server on port 3001..."
54
59
  if File.exists?('script/server')
data/sauce.gemspec CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{sauce}
5
- s.version = "0.17.2"
5
+ s.version = "0.17.3.alpha1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Sean Grove", "Eric Allen", "Steven Hazel"]
data/test/test_config.rb CHANGED
@@ -69,6 +69,6 @@ class TestConfig < Test::Unit::TestCase
69
69
 
70
70
  def test_clears_config
71
71
  Sauce.config {|c|}
72
- assert_not_equal [["Windows 2003", "firefox", "3.6."]], Sauce::Config.new.browsers
72
+ assert_equal [["Windows 2003", "firefox", "3.6."]], Sauce::Config.new.browsers
73
73
  end
74
74
  end
metadata CHANGED
@@ -1,13 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sauce
3
3
  version: !ruby/object:Gem::Version
4
- hash: 95
5
- prerelease:
4
+ hash: -3702664618
5
+ prerelease: 7
6
6
  segments:
7
7
  - 0
8
8
  - 17
9
- - 2
10
- version: 0.17.2
9
+ - 3
10
+ - alpha
11
+ - 1
12
+ version: 0.17.3.alpha1
11
13
  platform: ruby
12
14
  authors:
13
15
  - Sean Grove