aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-03-12 11:50:45 +0100
committerJosé Valim <jose.valim@gmail.com>2010-03-12 11:50:45 +0100
commit839362fa07de3f7bdf1fc1a361ff456cd02efc4e (patch)
treea42bf1eeba5db1428d2ddabb2c1ec2650a907071 /actionpack/test
parentf10631e13d373523c1ede9c73a5d7eb2e0529a27 (diff)
downloadrails-839362fa07de3f7bdf1fc1a361ff456cd02efc4e.tar.gz
rails-839362fa07de3f7bdf1fc1a361ff456cd02efc4e.tar.bz2
rails-839362fa07de3f7bdf1fc1a361ff456cd02efc4e.zip
Make all AP tests pass for Ruby 1.9.1.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/mount_test.rb8
-rw-r--r--actionpack/test/lib/fixture_template.rb5
-rw-r--r--actionpack/test/template/lookup_context_test.rb4
3 files changed, 8 insertions, 9 deletions
diff --git a/actionpack/test/dispatch/mount_test.rb b/actionpack/test/dispatch/mount_test.rb
index f89e5fda07..00ca5ec9dc 100644
--- a/actionpack/test/dispatch/mount_test.rb
+++ b/actionpack/test/dispatch/mount_test.rb
@@ -1,12 +1,12 @@
require 'abstract_unit'
class TestRoutingMount < ActionDispatch::IntegrationTest
- SprocketsApp = lambda { |env|
- [200, {"Content-Type" => "text/html"}, ["#{env["SCRIPT_NAME"]} -- #{env["PATH_INFO"]}"]]
- }
-
Router = ActionDispatch::Routing::RouteSet.new
Router.draw do
+ SprocketsApp = lambda { |env|
+ [200, {"Content-Type" => "text/html"}, ["#{env["SCRIPT_NAME"]} -- #{env["PATH_INFO"]}"]]
+ }
+
mount SprocketsApp, :at => "/sprockets"
mount SprocketsApp => "/shorthand"
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
diff --git a/actionpack/test/template/lookup_context_test.rb b/actionpack/test/template/lookup_context_test.rb
index bf07735724..697ebc694a 100644
--- a/actionpack/test/template/lookup_context_test.rb
+++ b/actionpack/test/template/lookup_context_test.rb
@@ -33,9 +33,7 @@ class LookupContextTest < ActiveSupport::TestCase
end
test "does not allow details to be modified in place" do
- assert_raise TypeError do
- @lookup_context.details.clear
- end
+ assert @lookup_context.details.frozen?
end
test "allows me to update an specific detail" do