Skip to content
This repository
Browse code

Merge pull request #5600 from carlosantoniodasilva/fix-build-3-0

Fix build for branch 3-0-stable - failing in ruby 1.8.8-p358
  • Loading branch information...
commit 5790269af9583445f76a5c5580609afc1448bcdc 2 parents 3627cfa + 9698312
José Valim authored March 27, 2012
9  actionpack/lib/action_view/testing/resolvers.rb
@@ -22,10 +22,11 @@ def query(path, exts, formats)
22 22
       end
23 23
 
24 24
       templates = []
25  
-      @hash.select { |k,v| k =~ /^#{query}$/ }.each do |path, source|
26  
-        handler, format = extract_handler_and_format(path, formats)
27  
-        templates << Template.new(source, path, handler,
28  
-          :virtual_path => path, :format => format)
  25
+      @hash.each do |_path, source|
  26
+        next unless _path =~ /^#{query}$/
  27
+        handler, format = extract_handler_and_format(_path, formats)
  28
+        templates << Template.new(source, _path, handler,
  29
+          :virtual_path => _path, :format => format)
29 30
       end
30 31
 
31 32
       templates.sort_by {|t| -t.identifier.match(/^#{query}$/).captures.reject(&:blank?).size }
24  actionpack/test/controller/new_base/render_rjs_test.rb
@@ -4,18 +4,18 @@ module RenderRjs
4 4
   class BasicController < ActionController::Base
5 5
     layout "application", :only => :index_respond_to
6 6
 
7  
-    self.view_paths = [ActionView::FixtureResolver.new(
8  
-      "layouts/application.html.erb"           => "",
9  
-      "render_rjs/basic/index.js.rjs"          => "page[:customer].replace_html render(:partial => 'customer')",
10  
-      "render_rjs/basic/index_html.js.rjs"     => "page[:customer].replace_html :partial => 'customer'",
11  
-      "render_rjs/basic/index_no_js.js.erb"    => "<%= render(:partial => 'developer') %>",
12  
-      "render_rjs/basic/_customer.js.erb"      => "JS Partial",
13  
-      "render_rjs/basic/_customer.html.erb"    => "HTML Partial",
14  
-      "render_rjs/basic/_developer.html.erb"   => "HTML Partial",
15  
-      "render_rjs/basic/index_locale.js.rjs"   => "page[:customer].replace_html :partial => 'customer'",
16  
-      "render_rjs/basic/_customer.da.html.erb" => "Danish HTML Partial",
17  
-      "render_rjs/basic/_customer.da.js.erb"   => "Danish JS Partial"
18  
-    )]
  7
+    self.view_paths = [ActionView::FixtureResolver.new(ActiveSupport::OrderedHash[
  8
+      "layouts/application.html.erb"           , "",
  9
+      "render_rjs/basic/index.js.rjs"          , "page[:customer].replace_html render(:partial => 'customer')",
  10
+      "render_rjs/basic/index_html.js.rjs"     , "page[:customer].replace_html :partial => 'customer'",
  11
+      "render_rjs/basic/index_no_js.js.erb"    , "<%= render(:partial => 'developer') %>",
  12
+      "render_rjs/basic/_customer.js.erb"      , "JS Partial",
  13
+      "render_rjs/basic/_customer.html.erb"    , "HTML Partial",
  14
+      "render_rjs/basic/_developer.html.erb"   , "HTML Partial",
  15
+      "render_rjs/basic/index_locale.js.rjs"   , "page[:customer].replace_html :partial => 'customer'",
  16
+      "render_rjs/basic/_customer.da.html.erb" , "Danish HTML Partial",
  17
+      "render_rjs/basic/_customer.da.js.erb"   , "Danish JS Partial"
  18
+    ])]
19 19
 
20 20
     def index
21 21
       render
14  actionpack/test/template/form_options_helper_test.rb
@@ -921,17 +921,15 @@ def test_option_html_attributes_with_single_element_hash
921 921
   end
922 922
 
923 923
   def test_option_html_attributes_with_multiple_element_hash
924  
-    assert_dom_equal(
925  
-      " class=\"fancy\" onclick=\"alert('Hello World');\"",
926  
-      option_html_attributes([ 'foo', 'bar', { :class => 'fancy', 'onclick' => "alert('Hello World');" } ])
927  
-    )
  924
+    output = option_html_attributes([ 'foo', 'bar', { :class => 'fancy', 'onclick' => "alert('Hello World');" } ])
  925
+    assert output.include?(" class=\"fancy\"")
  926
+    assert output.include?(" onclick=\"alert('Hello World');\"")
928 927
   end
929 928
 
930 929
   def test_option_html_attributes_with_multiple_hashes
931  
-    assert_dom_equal(
932  
-      " class=\"fancy\" onclick=\"alert('Hello World');\"",
933  
-      option_html_attributes([ 'foo', 'bar', { :class => 'fancy' }, { 'onclick' => "alert('Hello World');" } ])
934  
-    )
  930
+    output = option_html_attributes([ 'foo', 'bar', { :class => 'fancy' }, { 'onclick' => "alert('Hello World');" } ])
  931
+    assert output.include?(" class=\"fancy\"")
  932
+    assert output.include?(" onclick=\"alert('Hello World');\"")
935 933
   end
936 934
 
937 935
   def test_option_html_attributes_with_special_characters

0 notes on commit 5790269

Please sign in to comment.
Something went wrong with that request. Please try again.