sauce 0.12.0 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/sauce/integrations.rb +30 -29
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.12.
|
1
|
+
0.12.1
|
data/lib/sauce/integrations.rb
CHANGED
@@ -157,51 +157,52 @@ begin
|
|
157
157
|
rescue LoadError
|
158
158
|
# User doesn't have Test::Unit installed
|
159
159
|
end
|
160
|
-
begin
|
161
|
-
require 'test/unit/ui/console/testrunner'
|
162
|
-
class Test::Unit::UI::Console::TestRunner
|
163
|
-
def attach_to_mediator_with_sauce_tunnel
|
164
|
-
@mediator.add_listener(Test::Unit::UI::TestRunnerMediator::STARTED, &method(:start_tunnel))
|
165
|
-
@mediator.add_listener(Test::Unit::UI::TestRunnerMediator::FINISHED, &method(:stop_tunnel))
|
166
|
-
attach_to_mediator_without_sauce_tunnel
|
167
|
-
end
|
168
|
-
|
169
|
-
alias_method :attach_to_mediator_without_sauce_tunnel, :attach_to_mediator
|
170
|
-
alias_method :attach_to_mediator, :attach_to_mediator_with_sauce_tunnel
|
171
160
|
|
172
|
-
|
161
|
+
if defined?(Test::Unit::AutoRunner)
|
162
|
+
class Test::Unit::AutoRunner
|
163
|
+
run_without_tunnel = self.instance_method(:run)
|
173
164
|
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
165
|
+
define_method(:run) do |*args|
|
166
|
+
@suite = @collector[self]
|
167
|
+
need_tunnel = suite.tests.any? do |test_suite|
|
168
|
+
test_suite.tests.any? do |test_case|
|
169
|
+
[Sauce::TestCase, Sauce::RailsTestCase].include? test_case.class.superclass
|
170
|
+
end
|
179
171
|
end
|
180
|
-
|
181
|
-
|
182
|
-
|
172
|
+
if need_tunnel
|
173
|
+
config = Sauce::Config.new
|
174
|
+
if config.application_host && !config.local?
|
175
|
+
@sauce_tunnel = Sauce::Connect.new(:host => config.application_host, :port => config.application_port || 80)
|
176
|
+
@sauce_tunnel.wait_until_ready
|
177
|
+
end
|
178
|
+
end
|
179
|
+
result = run_without_tunnel.bind(self).call(*args)
|
183
180
|
if defined? @sauce_tunnel
|
184
181
|
@sauce_tunnel.disconnect
|
185
182
|
end
|
183
|
+
return result
|
186
184
|
end
|
187
185
|
end
|
188
|
-
rescue LoadError
|
189
|
-
# User is on Ruby 1.9
|
190
186
|
end
|
191
187
|
|
192
188
|
begin
|
193
189
|
require 'minitest/unit'
|
194
190
|
module MiniTest
|
195
191
|
class Unit
|
196
|
-
run_without_tunnel = self.instance_method(:
|
192
|
+
run_without_tunnel = self.instance_method(:run_test_suites)
|
197
193
|
|
198
|
-
define_method(:
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
194
|
+
define_method(:run_test_suites) do |*args|
|
195
|
+
need_tunnel = TestCase.test_suites.any? do |suite|
|
196
|
+
[Sauce::TestCase, Sauce::RailsTestCase].include? suite.superclass
|
197
|
+
end
|
198
|
+
if need_tunnel
|
199
|
+
config = Sauce::Config.new
|
200
|
+
if config.application_host && !config.local?
|
201
|
+
@sauce_tunnel = Sauce::Connect.new(:host => config.application_host, :port => config.application_port || 80)
|
202
|
+
@sauce_tunnel.wait_until_ready
|
203
|
+
end
|
203
204
|
end
|
204
|
-
result = run_without_tunnel.bind(self).call(args)
|
205
|
+
result = run_without_tunnel.bind(self).call(*args)
|
205
206
|
if defined? @sauce_tunnel
|
206
207
|
@sauce_tunnel.disconnect
|
207
208
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sauce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 45
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 12
|
9
|
-
-
|
10
|
-
version: 0.12.
|
9
|
+
- 1
|
10
|
+
version: 0.12.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Sean Grove
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-12-
|
19
|
+
date: 2010-12-14 00:00:00 -08:00
|
20
20
|
default_executable: sauce
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|