Class: RSpec::Rails::ViewRendering::EmptyTemplatePathSetDecorator

Inherits:
ActionView::Resolver
  • Object
show all
Defined in:
lib/rspec/rails/view_rendering.rb

Overview

Delegates find_all to the submitted path set and then returns templates with modified source

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(original_path_set) ⇒ EmptyTemplatePathSetDecorator

Returns a new instance of EmptyTemplatePathSetDecorator.



55
56
57
# File 'lib/rspec/rails/view_rendering.rb', line 55

def initialize(original_path_set)
  @original_path_set = original_path_set
end

Instance Attribute Details

#original_path_setObject (readonly)

Returns the value of attribute original_path_set.



53
54
55
# File 'lib/rspec/rails/view_rendering.rb', line 53

def original_path_set
  @original_path_set
end

Instance Method Details

#find_all(*args) ⇒ Object



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/rspec/rails/view_rendering.rb', line 59

def find_all(*args)
  original_path_set.find_all(*args).collect do |template|
    ::ActionView::Template.new(
      "",
      template.identifier,
      template.handler,
      {
        :virtual_path => template.virtual_path,
        :format => template.formats
      }
    )
  end
end