Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Better inspect for routed endpoint

  • Loading branch information...
commit ac034011cb641c8c729bc22847fae0247ec7cc7d 1 parent f1af6a3
@markevans authored
View
4 lib/dragonfly/routed_endpoint.rb
@@ -18,6 +18,10 @@ def call(env)
[400, {"Content-Type" => 'text/plain'}, ["The SHA parameter you gave (#{e}) is incorrect"]]
end
+ def inspect
+ "<#{self.class.name} for app #{@app.name.inspect} >"
+ end
+
private
def routing_params(env)
View
4 spec/dragonfly/routed_endpoint_spec.rb
@@ -44,5 +44,9 @@ def env_for(url, opts={})
response = response_for @endpoint.call(env)
response.body.should == 'wassup'
end
+
+ it "should have nice inspect output" do
+ @endpoint.inspect.should =~ /<Dragonfly::RoutedEndpoint for app :test_[_\w]* >/
+ end
end
Please sign in to comment.
Something went wrong with that request. Please try again.