Skip to content

Commit

Permalink
Whitespace + formatting
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9089 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
jeremy committed Mar 25, 2008
1 parent b0bfcca commit 4942e5b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 16 deletions.
10 changes: 4 additions & 6 deletions actionpack/lib/action_view/template_finder.rb
Expand Up @@ -159,12 +159,10 @@ def find_template_extension_from_first_render
end end


private private

def check_view_paths(view_paths)
def check_view_paths(view_paths) view_paths.each do |path|
view_paths.each do |path| raise InvalidViewPath.new(path) unless @@processed_view_paths.has_key?(path)
raise InvalidViewPath.new(path) unless @@processed_view_paths.has_key?(path) end
end end
end

end end
end end
17 changes: 7 additions & 10 deletions actionpack/test/template/template_finder_test.rb
Expand Up @@ -30,8 +30,8 @@ def test_should_cache_dir_content_properly
assert_equal Dir.glob("#{LOAD_PATH_ROOT}/**/*").find_all {|f| !File.directory?(f) }.size, assert_equal Dir.glob("#{LOAD_PATH_ROOT}/**/*").find_all {|f| !File.directory?(f) }.size,
ActionView::TemplateFinder.processed_view_paths[LOAD_PATH_ROOT].size ActionView::TemplateFinder.processed_view_paths[LOAD_PATH_ROOT].size
end end

def test_find_template_extension_from_first_render def test_find_template_extension_from_first_render
assert_nil @finder.send(:find_template_extension_from_first_render) assert_nil @finder.send(:find_template_extension_from_first_render)


{ {
Expand All @@ -50,26 +50,23 @@ def test_find_template_extension_from_first_render
assert_equal expectation, @finder.send(:find_template_extension_from_first_render) assert_equal expectation, @finder.send(:find_template_extension_from_first_render)
end end
end end

def test_should_report_file_exists_correctly def test_should_report_file_exists_correctly
assert_nil @finder.send(:find_template_extension_from_first_render) assert_nil @finder.send(:find_template_extension_from_first_render)
assert_equal false, @finder.send(:file_exists?, 'test.rhtml') assert_equal false, @finder.send(:file_exists?, 'test.rhtml')
assert_equal false, @finder.send(:file_exists?, 'test.rb') assert_equal false, @finder.send(:file_exists?, 'test.rb')


@template.instance_variable_set('@first_render', 'foo.rb') @template.instance_variable_set('@first_render', 'foo.rb')

assert_equal 'rb', @finder.send(:find_template_extension_from_first_render) assert_equal 'rb', @finder.send(:find_template_extension_from_first_render)
assert_equal false, @finder.send(:file_exists?, 'baz') assert_equal false, @finder.send(:file_exists?, 'baz')
assert_equal false, @finder.send(:file_exists?, 'baz.rb') assert_equal false, @finder.send(:file_exists?, 'baz.rb')
end end

uses_mocha 'Template finder tests' do


uses_mocha 'Template finder tests' do
def test_should_update_extension_cache_when_template_handler_is_registered def test_should_update_extension_cache_when_template_handler_is_registered
ActionView::TemplateFinder.expects(:update_extension_cache_for).with("funky") ActionView::TemplateFinder.expects(:update_extension_cache_for).with("funky")
ActionView::Template::register_template_handler :funky, Class.new(ActionView::TemplateHandler) ActionView::Template::register_template_handler :funky, Class.new(ActionView::TemplateHandler)
end end

end end

end end

0 comments on commit 4942e5b

Please sign in to comment.