Permalink
Browse files

Better inspect for routed endpoint

  • Loading branch information...
Mark Evans
Mark Evans committed Mar 9, 2012
1 parent f1af6a3 commit ac034011cb641c8c729bc22847fae0247ec7cc7d
Showing with 8 additions and 0 deletions.
  1. +4 −0 lib/dragonfly/routed_endpoint.rb
  2. +4 −0 spec/dragonfly/routed_endpoint_spec.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)
@@ -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

0 comments on commit ac03401

Please sign in to comment.