File: reload_all_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 (36 lines) | stat: -rw-r--r-- 999 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
29
30
31
32
33
34
35
36
require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')

module PhusionPassenger

shared_examples_for "a Rails spawner that supports #reload()" do
	it "#reload() reloads all applications" do
		use_some_stub do |stub1|
		use_some_stub do |stub2|
			File.append(stub1.startup_file, %q{
				File.write("output.txt", "stub 1")
			})
			spawn_stub_application(stub1).close
			File.append(stub2.startup_file, %q{
				File.write("output.txt", "stub 2")
			})
			spawn_stub_application(stub2).close
			
			spawner.reload
			
			File.append(stub1.startup_file, %q{
				File.write("output.txt", "stub 1 modified")
			})
			spawn_stub_application(stub1).close
			File.append(stub2.startup_file, %q{
				File.write("output.txt", "stub 2 modified")
			})
			spawn_stub_application(stub2).close
			
			File.read("#{stub1.app_root}/output.txt").should == "stub 1 modified"
			File.read("#{stub2.app_root}/output.txt").should == "stub 2 modified"
		end
		end
	end
end

end # module PhusionPassenger