Permalink
Browse files

Undeprecate test method delegation to @response

  • Loading branch information...
1 parent 91922b7 commit 3d5e099233266ed66eac9d058a6682d648a7e516 @rtomayko rtomayko committed Jan 14, 2009
Showing with 10 additions and 17 deletions.
  1. +10 −17 lib/sinatra/test.rb
View
@@ -48,12 +48,16 @@ def follow!
test_request 'GET', @response.location
end
- def body
- @response.body
- end
-
- def status
- @response.status
+ def body ; @response.body ; end
+ def status ; @response.status ; end
+
+ # Delegate other missing methods to @response.
+ def method_missing(name, *args, &block)
+ if @response && @response.respond_to?(name)
+ @response.send(name, *args, &block)
+ else
+ super
+ end
end
RACK_OPT_NAMES = {
@@ -92,17 +96,6 @@ def #{verb}_it(*args, &block)
end
RUBY
end
-
- # Deprecated. Tests no longer delegate missing methods to the
- # mock response. Use: @response
- def method_missing(name, *args, &block)
- if @response && @response.respond_to?(name)
- sinatra_warn "The #{name} method is deprecated; use @response.#{name} instead."
- @response.send(name, *args, &block)
- else
- super
- end
- end
end
end

0 comments on commit 3d5e099

Please sign in to comment.