public
Description: a Scheme written in Ruby, but implemented on the bus!
Homepage: http://bus-scheme.rubyforge.org
Clone URL: git://github.com/technomancy/bus-scheme.git
Testing that the body of a scheme rack app can be dynamic

It's a little cumbersome to type the return values with
(cons ()...), perhaps we should define a function (in scheme)
to help out with this.
JackDanger (author)
Sun Jun 01 21:54:33 -0700 2008
commit  011345b76a3a58752841c9a89cbe606a52f1f864
tree    95c5c00f0545bbfccd3b687fec6dec3c7d3a006b
parent  cd1ecc9bfdb5290e8cc52fa118c98948e3f2516c
...
19
20
21
 
 
 
 
 
 
22
23
24
...
40
41
42
 
 
 
 
 
 
 
43
44
45
...
19
20
21
22
23
24
25
26
27
28
29
30
...
46
47
48
49
50
51
52
53
54
55
56
57
58
0
@@ -19,6 +19,12 @@ if defined? BusScheme::Web::Resource
0
       @simple_app = eval!(simple_lambda)
0
       eval! "(defwebapp \"/simple\" #{simple_lambda})"
0
       
0
+ # this app returns the SERVER_INFO from the env passed to it
0
+ # TODO: come up with a better method for easily returning these values
0
+ eval! '(defwebapp "/who-am-i" (lambda (env)
0
+ (cons "200"
0
+ (cons (quote ("Content-Type" "text/html"))
0
+ (env "PATH_INFO")))))'
0
     end
0
     
0
     def test_app_can_be_called
0
@@ -40,6 +46,13 @@ if defined? BusScheme::Web::Resource
0
       assert_equal 'This is Simple', @response.body
0
     end
0
 
0
+ def test_returning_environment_as_body
0
+ get '/who-am-i'
0
+ assert_equal "/who-am-i", @response.body
0
+ assert_equal 'text/html', @response.headers['Content-Type']
0
+ assert_response_code 200
0
+ end
0
+
0
     private
0
     
0
     def get(path)

Comments

    No one has commented yet.