Skip to content

Commit

Permalink
add ability to provide path information to requests
Browse files Browse the repository at this point in the history
  • Loading branch information
dj2 committed Mar 8, 2011
1 parent 517488d commit 9558fc5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/goliath/test_helper.rb
Expand Up @@ -98,7 +98,8 @@ def hookup_request_callbacks(req, errback, &blk)
# @param errback [Proc] An error handler to attach
# @param blk [Proc] The callback block to execute
def get_request(request_data = {}, errback = nil, &blk)
req = EM::HttpRequest.new('http://localhost:9000').get(request_data)
path = request_data.delete(:path) || ''
req = EM::HttpRequest.new("http://localhost:9000#{path}").get(request_data)
hookup_request_callbacks(req, errback, &blk)
end

Expand All @@ -108,7 +109,8 @@ def get_request(request_data = {}, errback = nil, &blk)
# @param errback [Proc] An error handler to attach
# @param blk [Proc] The callback block to execute
def post_request(request_data = {}, errback = nil, &blk)
req = EM::HttpRequest.new('http://localhost:9000').post(request_data)
path = request_data.delete(:path) || ''
req = EM::HttpRequest.new("http://localhost:9000#{path}").post(request_data)
hookup_request_callbacks(req, errback, &blk)
end
end
Expand Down

0 comments on commit 9558fc5

Please sign in to comment.