Skip to content

Commit

Permalink
Fix a problem when Ruby 1.9.1 was used to run the test_server script
Browse files Browse the repository at this point in the history
  • Loading branch information
Phil Toland committed Sep 3, 2010
1 parent 938705a commit 0f1bc36
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions script/test_server
Expand Up @@ -27,6 +27,15 @@ require 'yaml'
require 'webrick'
include WEBrick

# This ugly little hack is necessary to make the specs pass when running
# the test_server script under Ruby 1.9. URI::Parser#to_yaml generates
# regexp representations that YAML.parse cannot parse.
class URI::Parser
def to_yaml(opts = {})
{}.to_yaml(opts)
end
end

class TestServlet < HTTPServlet::AbstractServlet
def respond_with(method, req, res)
res.body = req.to_yaml
Expand Down

0 comments on commit 0f1bc36

Please sign in to comment.