test/spec_rack_cgi.rb in rack-0.3.0 vs test/spec_rack_cgi.rb in rack-0.4.0
- old
+ new
@@ -10,16 +10,17 @@
end
# Keep this first.
specify "startup" do
$pid = fork {
- Dir.chdir File.join(File.dirname(__FILE__), 'cgi')
+ Dir.chdir(File.join(File.dirname(__FILE__), "..", "test", "cgi"))
exec "lighttpd -D -f lighttpd.conf"
}
end
specify "should respond" do
+ sleep 1
lambda {
GET("/test")
}.should.not.raise
end
@@ -27,11 +28,11 @@
GET("/test")
status.should.be 200
response["SERVER_SOFTWARE"].should =~ /lighttpd/
response["HTTP_VERSION"].should.equal "HTTP/1.1"
response["SERVER_PROTOCOL"].should.equal "HTTP/1.1"
- response["SERVER_PORT"].should.equal "9203"
- response["SERVER_NAME"].should =~ "0.0.0.0"
+ response["SERVER_PORT"].should.equal @port.to_s
+ response["SERVER_NAME"].should =~ @host
end
specify "should have rack headers" do
GET("/test")
response["rack.version"].should.equal [0,1]