pivotal-selenium-rc 1.5.20090512 → 1.6.20090512

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/CHANGES ADDED
@@ -0,0 +1,3 @@
1
+ 1.6.20090512
2
+ Properly terminate server when the process exits.
3
+ Fixed server blocking the process issue.
data/VERSION.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 1
3
- :minor: 5
3
+ :minor: 6
4
4
  :patch: 20090512
5
5
  :jar_url: http://nexus.openqa.org/content/repositories/snapshots/org/seleniumhq/selenium/selenium-remote-control/1.0-SNAPSHOT/selenium-remote-control-1.0-20090512.181627-79-dist.zip
@@ -41,7 +41,9 @@ module SeleniumRC
41
41
  command << " -port #{self.class.port}"
42
42
  command << " #{argv.join(' ')}" if argv.length > 0
43
43
  log "Running: #{command}"
44
- system(command)
44
+ Thread.start do
45
+ system(command)
46
+ end
45
47
  end
46
48
 
47
49
  def stop_at_exit
@@ -10,21 +10,25 @@ describe "bin/selenium-rc" do
10
10
  end
11
11
  end
12
12
 
13
- after do
14
- SeleniumRC::Server.new.stop
15
- TCPSocket.wait_for_service_termination(:host => "0.0.0.0", :port => 4444)
16
- end
17
-
18
- it "starts the SeleniumRC server from the downloaded jar file" do
13
+ it "starts the SeleniumRC server from the downloaded jar file and terminates it when finished" do
14
+ thread = nil
19
15
  Dir.chdir(root_dir) do
20
- system("bin/selenium-rc &") || raise("bin/selenium-server failed")
16
+ thread = Thread.start do
17
+ system("bin/selenium-rc") || raise("bin/selenium-server failed")
18
+ end
21
19
  end
22
20
 
21
+ timeout {SeleniumRC::Server.service_is_running?}
22
+ thread.kill
23
+ timeout {!SeleniumRC::Server.service_is_running?}
24
+ end
25
+
26
+ def timeout
23
27
  start_time = Time.now
24
- timeout = 15
25
- until SeleniumRC::Server.service_is_running?
26
- if Time.now > (start_time + timeout)
27
- raise SocketError.new("Socket did not open within #{timeout} seconds")
28
+ timeout_length = 15
29
+ until yield
30
+ if Time.now > (start_time + timeout_length)
31
+ raise SocketError.new("Socket did not open within #{timeout_length} seconds")
28
32
  end
29
33
  end
30
34
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pivotal-selenium-rc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.20090512
4
+ version: 1.6.20090512
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pivotal Labs
@@ -12,7 +12,7 @@ autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
14
 
15
- date: 2009-05-12 00:00:00 -07:00
15
+ date: 2009-05-13 00:00:00 -07:00
16
16
  default_executable: selenium-rc
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
@@ -34,6 +34,7 @@ extensions:
34
34
  extra_rdoc_files:
35
35
  - README.markdown
36
36
  files:
37
+ - CHANGES
37
38
  - README.markdown
38
39
  - Rakefile
39
40
  - VERSION.yml