jspec-steventux 3.3.2 → 3.3.2.1

Sign up to get free protection for your applications and to get access to all the features.
data/bin/jspec CHANGED
@@ -170,7 +170,8 @@ command :run do |c|
170
170
  c.option '-R', '--rhino', 'Run specs using Rhino'
171
171
  c.option '-N', '--node', 'Run specs using Node.js'
172
172
  c.option '-S', '--server', 'Run specs using the JSpec server'
173
- c.option '-P', '--port NUMBER', Integer, 'Start JSpec server using the given port number'
173
+ c.option '-P', '--port NUMBER', Integer, 'Start JSpec server using the given port number'
174
+ c.option '-T', '--timeout NUMBER', Integer, 'Timeout for browsers used in CI testing'
174
175
  c.when_called do |args, options|
175
176
  JSpec::Project.for('.').run! args.first, options.__hash__
176
177
  end
@@ -2,11 +2,11 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{jspec-steventux}
5
- s.version = "3.3.2"
5
+ s.version = "3.3.2.1"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["TJ Holowaychuk, S Laing"]
9
- s.date = %q{2010-02-25}
8
+ s.authors = ["original author TJ Holowaychuk, adaptation for CI testing by S Laing"]
9
+ s.date = %q{2010-05-18}
10
10
  s.default_executable = %q{jspec}
11
11
  s.description = %q{JavaScript BDD Testing Framework}
12
12
  s.email = %q{info@laingsolutions.com}
@@ -51,7 +51,8 @@ class Browser
51
51
  def teardown_linux
52
52
  psout = IO.popen "ps -ef | grep #{self.to_s.downcase} | grep -v grep"
53
53
  psout.readlines.each { |psline|
54
- pid = psline.split(/[\s]+/)[1].to_i
54
+ pid = psline.split(/[\s]+/)[1].to_i
55
+ puts "Killing browser process #{pid}"
55
56
  Process.kill 9, pid
56
57
  }
57
58
  end
@@ -197,6 +197,7 @@ module JSpec
197
197
 
198
198
  def start_server path, options = {}
199
199
  options[:port] ||= 4444
200
+ options[:timeout] ||= 15
200
201
  set :port, options[:port]
201
202
  set :server, 'Mongrel'
202
203
  enable :sessions
@@ -204,7 +205,7 @@ module JSpec
204
205
  hook = File.expand_path normalize('server.rb')
205
206
  load hook if File.exists? hook
206
207
  browsers = browsers_for(options[:browsers]) if options.include? :browsers
207
- JSpec::Server.new(path, options[:port]).start(browsers)
208
+ JSpec::Server.new(path, options[:port], options[:timeout]).start(browsers)
208
209
  end
209
210
 
210
211
  ##
@@ -30,11 +30,17 @@ module JSpec
30
30
 
31
31
  attr_reader :server
32
32
 
33
+ ##
34
+ # TTL for browsers
35
+
36
+ attr_reader :timeout
37
+
38
+
33
39
  ##
34
40
  # Initialize.
35
41
 
36
- def initialize suite, port
37
- @suite, @port, @host = suite, port, :localhost
42
+ def initialize suite, port, timeout
43
+ @suite, @port, @timeout, @host = suite, port, timeout, :localhost
38
44
  end
39
45
 
40
46
  ##
@@ -50,7 +56,7 @@ module JSpec
50
56
  def start browsers = nil
51
57
  browsers ||= Browser.subclasses.map { |browser| browser.new }
52
58
  browsers.map do |browser|
53
- Thread.new {
59
+ Thread.new {
54
60
  sleep 1
55
61
  if browser.supported?
56
62
  browser.setup
@@ -59,13 +65,13 @@ module JSpec
59
65
  end
60
66
  }
61
67
  Thread.new {
62
- sleep 10
63
- browser.teardown
64
- }
68
+ sleep timeout
69
+ browser.teardown
70
+ }
65
71
  end.push(Thread.new {
66
72
  start!
67
73
  }).push(Thread.new {
68
- sleep 10
74
+ sleep ((timeout * browsers.size) + 1)
69
75
  stop!
70
76
  }).reverse.each { |thread| thread.join }
71
77
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jspec-steventux
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.2
4
+ version: 3.3.2.1
5
5
  platform: ruby
6
6
  authors:
7
- - TJ Holowaychuk, S Laing
7
+ - original author TJ Holowaychuk, adaptation for CI testing by S Laing
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-25 00:00:00 +00:00
12
+ date: 2010-05-18 00:00:00 +01:00
13
13
  default_executable: jspec
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency