public
Description: Phusion Passenger (mod_rails)
Homepage: http://www.modrails.com/
Clone URL: git://github.com/FooBarWidget/passenger.git
Click here to lend your support to: passenger and make a donation at www.pledgie.com !
Hongli Lai (Phusion) (author)
Thu May 01 11:19:37 -0700 2008
passenger / test / spawn_server_spec.rb
100644 26 lines (21 sloc) 0.734 kb
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 'abstract_server_spec'
 
shared_examples_for "a spawn server" do
  it_should_behave_like "AbstractServer"
  
  it "should raise an AbstractServer::ServerError if the server was killed" do
    Process.kill('SIGABRT', @spawner.server_pid)
    spawning = lambda { spawn_application }
    spawning.should raise_error(AbstractServer::ServerError)
  end
  
  it "should work correctly after a restart, if something went wrong" do
    Process.kill('SIGABRT', @spawner.server_pid)
    spawning = lambda { spawn_application }
    spawning.should raise_error(AbstractServer::ServerError)
    
    @spawner.stop
    @spawner.start
    app = spawn_application
    app.pid.should_not == 0
    app.app_root.should_not be_nil
    app.close
  end
end