File: abstract_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 (23 lines) | stat: -rw-r--r-- 638 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
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

module PhusionPassenger

shared_examples_for "an AbstractServer" do
	it "doesn't crash if it's started and stopped multiple times" do
		3.times do
			# Give the server some time to install the
			# signal handlers. If we don't give it enough
			# time, it will raise an ugly exception when
			# we send it a signal.
			sleep 0.1
			server.stop
			server.start
		end
	end
	
	it "raises a ServerAlreadyStarted if the server is already started" do
		lambda { server.start }.should raise_error(AbstractServer::ServerAlreadyStarted)
	end
end

end # module PhusionPassenger