Permalink
Browse files

Always return a Rack body that has an #each method

Closes Issue #2
  • Loading branch information...
brynary committed Mar 16, 2011
1 parent cc793ab commit c26f1f8ebc2819c93e85e7843565efb73eb4f82d
@@ -15,7 +15,7 @@ def initialize(app, options = {})
def call(env)
if env["PATH_INFO"] == "/system/revision"
body = "#{@revision}\n"
- [200, { "Content-Type" => "text/plain", "Content-Length" => body.size.to_s }, body]
+ [200, { "Content-Type" => "text/plain", "Content-Length" => body.size.to_s }, [body]]
else
status, headers, body = @app.call(env)
headers["X-Revision"] = @revision.to_s
@@ -11,7 +11,7 @@
it "returns the current running revision" do
middleware = E20::Ops::Middleware::RevisionMiddleware.new(app, :revision => "rev")
status, headers, body = middleware.call({"PATH_INFO" => "/system/revision"})
- body.should == "rev\n"
+ body.should == ["rev\n"]
end
end

0 comments on commit c26f1f8

Please sign in to comment.