Skip to content

Commit

Permalink
Even cleaner.
Browse files Browse the repository at this point in the history
- Removed some unnecessaries that were left over from a spike.
- Happens.
  • Loading branch information
dchelimsky committed Jun 28, 2010
1 parent e41c174 commit 67bf65c
Showing 1 changed file with 12 additions and 15 deletions.
27 changes: 12 additions & 15 deletions lib/rspec/rails/view_rendering.rb
Expand Up @@ -20,26 +20,23 @@ def render_views?
end
end

# Delegates find_all to the submitted controller's view_paths and then
# returns templates with modified source
class PathSetDelegatorResolver < ::ActionView::Resolver
attr_reader :path_set
# Delegates find_all to the submitted path set and then returns templates
# with modified source
class PathSetDelegatorResolver < ::ActionView::Resolver
attr_reader :path_set

def initialize(path_set)
@path_set = path_set
end
def initialize(path_set)
@path_set = path_set
end

def find_all(*args)
templates = path_set.find_all(*args)
templates.each do |t|
t.singleton_class.class_eval do
def source
"Template source generated by RSpec."
end
end
def find_all(*args)
path_set.find_all(*args).each do |template|
def template.source
"Template source generated by RSpec."
end
end
end
end

included do
before do
Expand Down

0 comments on commit 67bf65c

Please sign in to comment.