Sha256: df13b9d653fe500dbec1f8d490c6736ba56fe5a2f15ef65405059dbe480e7406

Contents?: true

Size: 1 KB

Versions: 35

Compression:

Stored size: 1 KB

Contents

shared_examples_for "HelloWorld Rack application" do
	it "is possible to fetch static assets" do
		get('/rack.jpg').should == @stub.public_file('rack.jpg')
	end
	
	it "is possible to GET a regular Rack page" do
		get('/').should =~ /hello/
	end
	
	it "supports restarting via restart.txt" do
		get('/').should =~ /hello/
		File.write("#{@stub.app_root}/config.ru", %q{
			app = lambda do |env|
				[200, { "Content-Type" => "text/html" }, "changed"]
			end
			run app
		})
		File.new("#{@stub.app_root}/tmp/restart.txt", "w").close
		File.utime(2, 2, "#{@stub.app_root}/tmp/restart.txt")
		get('/').should == "changed"
	end
	
	if Process.uid == 0
		it "runs as an unprivileged user" do
			File.prepend("#{@stub.app_root}/config.ru", %q{
				File.new('foo.txt', 'w').close
			})
			File.new("#{@stub.app_root}/tmp/restart.txt", "w").close
			File.utime(1, 1, "#{@stub.app_root}/tmp/restart.txt")
			get('/')
			stat = File.stat("#{@stub.app_root}/foo.txt")
			stat.uid.should_not == 0
			stat.gid.should_not == 0
		end
	end
end

Version data entries

35 entries across 35 versions & 6 rubygems

Version Path
vanity-1.7.1 vendor/ruby/1.9.1/gems/passenger-2.2.15/test/integration_tests/hello_world_rack_spec.rb
passenger-3.0.7 test/integration_tests/hello_world_rack_spec.rb
passenger-3.0.6 test/integration_tests/hello_world_rack_spec.rb
passenger-3.0.5 test/integration_tests/hello_world_rack_spec.rb
passenger-3.0.4 test/integration_tests/hello_world_rack_spec.rb
passenger-3.0.3 test/integration_tests/hello_world_rack_spec.rb
railsware-passenger-3.0.2.1 test/integration_tests/hello_world_rack_spec.rb
passenger-3.0.2 test/integration_tests/hello_world_rack_spec.rb
passenger_dudemeister-3.0.1 test/integration_tests/hello_world_rack_spec.rb
passenger-3.0.1 test/integration_tests/hello_world_rack_spec.rb
passenger-3.0.0 test/integration_tests/hello_world_rack_spec.rb
passenger-3.0.0.pre4 test/integration_tests/hello_world_rack_spec.rb
passenger-3.0.0.pre3 test/integration_tests/hello_world_rack_spec.rb
passenger-3.0.0.pre2 test/integration_tests/hello_world_rack_spec.rb
passenger-3.0.0.pre1 test/integration_tests/hello_world_rack_spec.rb
passenger-2.2.15 test/integration_tests/hello_world_rack_spec.rb
passenger-2.2.14 test/integration_tests/hello_world_rack_spec.rb
passenger-2.2.13 test/integration_tests/hello_world_rack_spec.rb
passenger-2.2.12 test/integration_tests/hello_world_rack_spec.rb
colouringcode-passenger-0.2 test/integration_tests/hello_world_rack_spec.rb