diff --git a/actionpack/lib/action_view/template/resolver.rb b/actionpack/lib/action_view/template/resolver.rb index f5591ea..e5f888d 100644 --- a/actionpack/lib/action_view/template/resolver.rb +++ b/actionpack/lib/action_view/template/resolver.rb @@ -121,10 +121,10 @@ module ActionView # # :api: plugin def path_to_details(path) # [:erb, :format => :html, :locale => :en, :partial => true/false] - if m = path.match(%r'(?:^|/)(_)?[\w-]+(\.[\w-]+)*\.(\w+)$') + if m = path.match(%r'(?:^|/)(_)?[-\w]+((\.[-\w]+)*)\.(\w+)$') # added additional grouping to catch .locale.type partial = m[1] == '_' details = (m[2]||"").split('.').reject { |e| e.empty? } - handler = Template.handler_class_for_extension(m[3]) + handler = Template.handler_class_for_extension(m[4]) format = Mime[details.last] && details.pop.to_sym locale = details.last && details.pop.to_sym @@ -162,4 +162,4 @@ module ActionView @paths.first.to_s end end -end \ No newline at end of file +end diff --git a/actionpack/test/abstract_unit.rb b/actionpack/test/abstract_unit.rb index aef3dd6..e81b933 100644 --- a/actionpack/test/abstract_unit.rb +++ b/actionpack/test/abstract_unit.rb @@ -123,17 +123,16 @@ class ::ApplicationController < ActionController::Base end module ActionController - class << Routing - def possible_controllers + + def Routing.possible_controllers # to have consistent behaviour between 1.8.7 and higher versions of ruby @@possible_controllers ||= [] end - end class Base include ActionController::Testing def self.inherited(klass) - name = klass.name.underscore.sub(/_controller$/, '') + name = klass.name.to_s.underscore.sub(/_controller$/, '') # anonymous classes in 1.9 have NilClass as name, not empty string ActionController::Routing.possible_controllers << name unless name.blank? super end diff --git a/actionpack/test/controller/rescue_test.rb b/actionpack/test/controller/rescue_test.rb index 6ad708b..c039ae1 100644 --- a/actionpack/test/controller/rescue_test.rb +++ b/actionpack/test/controller/rescue_test.rb @@ -327,7 +327,7 @@ class RescueTest < ActionController::IntegrationTest test 'rescue routing exceptions' do @app = ActionDispatch::Rescue.new(ActionController::Routing::Routes) do - rescue_from ActionController::RoutingError, lambda { |env| [200, {"Content-Type" => "text/html"}, "Gotcha!"] } + rescue_from ActionController::RoutingError, lambda { |env| [200, {"Content-Type" => "text/html"}, ["Gotcha!"]] } # uncertain, but rack wants body#each end get '/b00m' diff --git a/actionpack/test/new_base/content_negotiation_test.rb b/actionpack/test/new_base/content_negotiation_test.rb index c43cb67..c44b11d 100644 --- a/actionpack/test/new_base/content_negotiation_test.rb +++ b/actionpack/test/new_base/content_negotiation_test.rb @@ -5,7 +5,7 @@ module ContentNegotiation # This has no layout and it works class BasicController < ActionController::Base self.view_paths = [ActionView::FixtureResolver.new( - "content_negotiation/basic/hello.html.erb" => "Hello world <%= request.formats %>!" + "content_negotiation/basic/hello.html.erb" => "Hello world <%= request.formats.collect(&:to_str).join(', ') %>!" # Array.to_s changed in 1.9.2 )] end diff --git a/actionpack/test/new_base/metal_test.rb b/actionpack/test/new_base/metal_test.rb index e1d46b9..29c01c4 100644 --- a/actionpack/test/new_base/metal_test.rb +++ b/actionpack/test/new_base/metal_test.rb @@ -20,8 +20,8 @@ module MetalTest class TestMiddleware < ActiveSupport::TestCase def setup @app = Rack::Builder.new do - use MetalMiddleware - run Endpoint.new + use ::MetalTest::MetalMiddleware # full-qualified name, otherwise error "Anonymous modules have no name to be referenced by" in 1.9.2 + run ::MetalTest::Endpoint.new end.to_app end diff --git a/actionpack/test/template/number_helper_test.rb b/actionpack/test/template/number_helper_test.rb index 85a97d5..0a2b82b 100644 --- a/actionpack/test/template/number_helper_test.rb +++ b/actionpack/test/template/number_helper_test.rb @@ -88,7 +88,7 @@ class NumberHelperTest < ActionView::TestCase assert_equal("111.00", number_with_precision(111, :precision => 2)) assert_equal("111.235", number_with_precision("111.2346")) assert_equal("31.83", number_with_precision("31.825", :precision => 2)) - assert_equal("3268", number_with_precision((32.675 * 100.00), :precision => 0)) + assert_equal("3268", number_with_precision((32.6751 * 100.00), :precision => 0)) # this is machine-specific, I sometimes got 32.675 * 100 == 3267.4999999999995 assert_equal("112", number_with_precision(111.50, :precision => 0)) assert_equal("1234567892", number_with_precision(1234567891.50, :precision => 0))