From 839362fa07de3f7bdf1fc1a361ff456cd02efc4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Valim?= Date: Fri, 12 Mar 2010 11:50:45 +0100 Subject: Make all AP tests pass for Ruby 1.9.1. --- actionpack/test/lib/fixture_template.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'actionpack/test/lib') diff --git a/actionpack/test/lib/fixture_template.rb b/actionpack/test/lib/fixture_template.rb index eda76ddfd0..02248d84ad 100644 --- a/actionpack/test/lib/fixture_template.rb +++ b/actionpack/test/lib/fixture_template.rb @@ -12,7 +12,7 @@ module ActionView #:nodoc: def query(partial, path, exts) query = Regexp.escape(path) exts.each do |ext| - query << '(?:' << ext.map {|e| e && Regexp.escape(".#{e}") }.join('|') << ')' + query << '(' << ext.map {|e| e && Regexp.escape(".#{e}") }.join('|') << ')' end templates = [] @@ -21,7 +21,8 @@ module ActionView #:nodoc: templates << Template.new(source, path, handler, :partial => partial, :virtual_path => path, :format => format) end - templates.sort_by {|t| -t.formats.size } + + templates.sort_by {|t| -t.identifier.match(/^#{query}$/).captures.reject(&:blank?).size } end end -- cgit v1.2.3