Skip to content

Commit c2aac54

Browse files
eugeneiusilianah
authored andcommitted
Make ResolverDecorator a subclass of ActionView::Resolver
Follows rails/rails@e65d41a. ActionView::PathSet now rejects resolvers unless they inherit from ActionView::Resolver, so ResolverDecorator must do so. By removing all inherited methods, we ensure that method_missing will still intercept all method calls. Co-authored-by: Iliana Hadzhiatanasova <[email protected]>
1 parent 948021c commit c2aac54

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/rspec/rails/view_rendering.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,15 @@ def self.template_format(template)
7171
# templates with modified source
7272
#
7373
# @private
74-
class ResolverDecorator
74+
class ResolverDecorator < ::ActionView::Resolver
75+
(::ActionView::Resolver.instance_methods - Object.instance_methods).each do |method|
76+
undef_method method
77+
end
78+
79+
(::ActionView::Resolver.methods - Object.methods).each do |method|
80+
singleton_class.undef_method method
81+
end
82+
7583
def initialize(resolver)
7684
@resolver = resolver
7785
end

0 commit comments

Comments
 (0)