public
Description: A very fast & simple Ruby web server
Homepage: http://code.macournoyer.com/thin/
Clone URL: git://github.com/macournoyer/thin.git
Search Repo:
Add specs for Swiftiply support.
macournoyer (author)
Fri Feb 08 22:43:29 -0800 2008
commit  40ce6f3b68577026c83ff47afbeae8f19c8588fd
tree    f8934fb86fe4422db8bf42457bc8528f4a498ff9
parent  1f3072c91b283c57c34cfc896488d6ff3dc69716
...
 
 
 
 
 
 
...
1
2
3
4
5
6
0
@@ -1 +1,7 @@
0
+cluster_address: 0.0.0.0
0
+cluster_port: 3333
0
+map:
0
+ - incoming: 127.0.0.1
0
+ outgoing: 127.0.0.1:5555
0
+ default: true
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
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
0
@@ -1 +1,28 @@
0
+require File.dirname(__FILE__) + '/../spec_helper'
0
+
0
+describe Server, 'on Swiftiply' do
0
+ before do
0
+ @swiftiply = fork do
0
+ exec "swiftiply -c #{File.dirname(__FILE__)}/swiftiply.yml"
0
+ end
0
+ sleep 0.5
0
+ start_server(Connectors::SwiftiplyClient.new('0.0.0.0', 5555, nil)) do |env|
0
+ body = env.inspect + env['rack.input'].read
0
+ [200, { 'Content-Type' => 'text/html', 'Content-Length' => body.size.to_s }, body]
0
+ end
0
+ end
0
+
0
+ it 'should GET from Net::HTTP' do
0
+ Net::HTTP.get(URI.parse("http://0.0.0.0:3333/?cthis")).should include('cthis')
0
+ end
0
+
0
+ it 'should POST from Net::HTTP' do
0
+ Net::HTTP.post_form(URI.parse("http://0.0.0.0:3333/"), :arg => 'pirate').body.should include('arg=pirate')
0
+ end
0
+
0
+ after do
0
+ stop_server
0
+ Process.kill(9, @swiftiply)
0
+ end
0
+end

Comments

    No one has commented yet.