Class: RSpec::Rails::ViewRendering::EmptyTemplateResolver::ResolverDecorator Private
Do not use. This class is for internal use only.
Relationships & Source Files | |
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
ActionView::Resolver
|
|
Instance Chain:
self,
ActionView::Resolver
|
|
Inherits: |
ActionView::Resolver
|
Defined in: | rspec-rails/lib/rspec/rails/view_rendering.rb |
Overview
Delegates all methods to the submitted resolver and for all methods that return a collection of ActionView::Template
instances, return templates with modified source
Class Method Summary
- .new(resolver) ⇒ ResolverDecorator constructor Internal use only
Instance Method Summary
- #method_missing(name, *args, &block) Internal use only
- #nullify_templates(collection) private Internal use only
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block)
[ GitHub ]# File 'rspec-rails/lib/rspec/rails/view_rendering.rb', line 87
def method_missing(name, *args, &block) result = @resolver.send(name, *args, &block) nullify_templates(result) end
Instance Method Details
#nullify_templates(collection) (private)
[ GitHub ]# File 'rspec-rails/lib/rspec/rails/view_rendering.rb', line 94
def nullify_templates(collection) return collection unless collection.is_a?(Enumerable) return collection unless collection.all? { |element| element.is_a?(::ActionView::Template) } EmptyTemplateResolver.nullify_template_rendering(collection) end