summaryrefslogtreecommitdiff
path: root/spec/functional/tiny_server_spec.rb
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2012-11-15 16:16:36 -0800
committerdanielsdeleo <dan@opscode.com>2012-11-19 14:05:15 -0800
commit9b39d2ca14733fe082fcd6e05d6c928219726d07 (patch)
tree0a57360a4330bdd79f525a845896215e674737da /spec/functional/tiny_server_spec.rb
parent1dbff12baedf3e8fca2ce3adcc4dfdbf2dd8fcdf (diff)
downloadchef-9b39d2ca14733fe082fcd6e05d6c928219726d07.tar.gz
replace thin w/ webrick for func. test server
Diffstat (limited to 'spec/functional/tiny_server_spec.rb')
-rw-r--r--spec/functional/tiny_server_spec.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/functional/tiny_server_spec.rb b/spec/functional/tiny_server_spec.rb
index 0cfef4305f..68ab9e7294 100644
--- a/spec/functional/tiny_server_spec.rb
+++ b/spec/functional/tiny_server_spec.rb
@@ -37,15 +37,16 @@ describe TinyServer::API do
it "creates a route for a GET request" do
@api.get('/foo/bar', 200, 'hello foobar')
- response = @api.call("REQUEST_METHOD" => "GET", "REQUEST_URI" => '/foo/bar')
- response.should == [200, {'Content-Type' => 'application/json'}, 'hello foobar']
+ # WEBrick gives you the full URI with host, Thin only gave the part after scheme+host+port
+ response = @api.call("REQUEST_METHOD" => "GET", "REQUEST_URI" => 'http://localhost:1974/foo/bar')
+ response.should == [200, {'Content-Type' => 'application/json'}, [ 'hello foobar' ]]
end
it "creates a route for a request with a block" do
block_called = false
@api.get('/bar/baz', 200) { block_called = true; 'hello barbaz' }
- response = @api.call("REQUEST_METHOD" => "GET", "REQUEST_URI" => '/bar/baz')
- response.should == [200, {'Content-Type' => 'application/json'}, 'hello barbaz']
+ response = @api.call("REQUEST_METHOD" => "GET", "REQUEST_URI" => 'http://localhost:1974/bar/baz')
+ response.should == [200, {'Content-Type' => 'application/json'}, [ 'hello barbaz' ]]
block_called.should be_true
end