Permalink
Browse files

override method via extend (avoids warning from Ruby)

  • Loading branch information...
1 parent e373d79 commit a550d08156b09223634859f3927cfa909465e3de @dchelimsky dchelimsky committed Aug 16, 2011
Showing with 6 additions and 2 deletions.
  1. +6 −2 lib/rspec/rails/example/controller_example_group.rb
@@ -144,12 +144,16 @@ def name; "AnonymousController" end
module InstanceMethods
attr_reader :controller, :routes
- def bypass_rescue
- def controller.rescue_with_handler(exception)
+ module BypassRescue
+ def rescue_with_handler(exception)
raise exception
end
end
+ def bypass_rescue
+ controller.extend(BypassRescue)
+ end
+
def method_missing(method, *args, &block)
if @orig_routes && @orig_routes.named_routes.helpers.include?(method)
controller.send(method, *args, &block)

0 comments on commit a550d08

Please sign in to comment.