File: spawn_server_spec.rb

package info (click to toggle)
ruby-passenger 3.0.13debian-1%2Bdeb7u2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 15,920 kB
  • sloc: cpp: 99,104; ruby: 18,098; ansic: 9,846; sh: 8,632; python: 141; makefile: 30
file content (28 lines) | stat: -rw-r--r-- 844 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')
require 'ruby/shared/abstract_server_spec'

module PhusionPassenger

shared_examples_for "a spawn server" do
	it "raises an AbstractServer::ServerError if the server was killed" do
		spawner   # Start the spawn server.
		Process.kill('SIGKILL', spawner.server_pid)
		spawning = lambda { spawn_some_application }
		spawning.should raise_error(AbstractServer::ServerError)
	end
	
	it "works correctly after a restart, if something went wrong" do
		filename = "#{Utils.passenger_tmpdir}/works.txt"
		before_start %Q{
			File.touch(#{filename.inspect})
		}
		spawner   # Start the spawn server.
		Process.kill('SIGKILL', spawner.server_pid)
		spawner.stop
		spawner.start
		spawn_some_application
		File.exist?(filename).should be_true
	end
end

end # module PhusionPassenger