public
Description: A very fast & simple Ruby web server
Homepage: http://code.macournoyer.com/thin/
Clone URL: git://github.com/macournoyer/thin.git
Fix builder test to work w/ Rack 0.3 and bump Rack version in env.
macournoyer (author)
Thu Feb 28 10:29:49 -0800 2008
commit  659446428f3dc609addbe940b26eb0d5638577e6
tree    39e7154b9206e777f0563e48da6dfc8d9afc95c8
parent  61da949188ac25c8e3560dc3f10fe4707c31583d
...
52
53
54
55
 
56
57
58
...
52
53
54
 
55
56
57
58
0
@@ -52,7 +52,7 @@ module Thin
0
         # Rack stuff
0
         RACK_INPUT => @body,
0
         
0
- RACK_VERSION => [0, 2],
0
+ RACK_VERSION => VERSION::RACK,
0
         RACK_ERRORS => STDERR,
0
         
0
         RACK_MULTITHREAD => false,
...
11
12
13
 
 
14
15
16
...
11
12
13
14
15
16
17
18
0
@@ -11,6 +11,8 @@ module Thin
0
     STRING = [MAJOR, MINOR, TINY].join('.')
0
     
0
     CODENAME = 'Fancy Pants'
0
+
0
+ RACK = [0, 3] # Latest Rack version that was tested
0
   end
0
   
0
   NAME = 'thin'.freeze
...
28
29
30
31
 
32
33
34
35
36
 
 
 
 
 
 
 
37
38
...
28
29
30
 
31
32
33
34
 
 
35
36
37
38
39
40
41
42
43
0
@@ -28,11 +28,16 @@ describe Server, 'app builder' do
0
   it "should work with Rack url mapper" do
0
     server = Server.new '0.0.0.0', 3000 do
0
       map '/test' do
0
- run(proc { |env| :works })
0
+ run(proc { |env| [200, {}, 'Found /test'] })
0
       end
0
     end
0
     
0
- server.app.call({})[0].should == 404
0
- server.app.call({'PATH_INFO' => '/test'}).should == :works
0
+ default_env = { 'SCRIPT_NAME' => '' }
0
+
0
+ server.app.call(default_env.update('PATH_INFO' => '/'))[0].should == 404
0
+
0
+ status, headers, body = server.app.call(default_env.update('PATH_INFO' => '/test'))
0
+ status.should == 200
0
+ body.should == 'Found /test'
0
   end
0
 end

Comments

    No one has commented yet.