File: spawn_server_spec.rb

package info (click to toggle)
passenger 2.2.11debian-2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 11,576 kB
  • ctags: 28,138
  • sloc: cpp: 66,323; ruby: 9,646; ansic: 2,425; python: 141; sh: 56; makefile: 29
file content (26 lines) | stat: -rw-r--r-- 761 bytes parent folder | download | duplicates (2)
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
require 'support/config'

require 'ruby/abstract_server_spec'

shared_examples_for "a spawn server" do
	it_should_behave_like "an AbstractServer"
	
	it "raises an AbstractServer::ServerError if the server was killed" do
		Process.kill('SIGABRT', @spawner.server_pid)
		spawning = lambda { spawn_arbitrary_application }
		spawning.should raise_error(AbstractServer::ServerError)
	end
	
	it "works correctly after a restart, if something went wrong" do
		Process.kill('SIGABRT', @spawner.server_pid)
		spawning = lambda { spawn_arbitrary_application }
		spawning.should raise_error(AbstractServer::ServerError)
		
		@spawner.stop
		@spawner.start
		app = spawn_arbitrary_application
		app.pid.should_not == 0
		app.app_root.should_not be_nil
		app.close
	end
end