From fe4fce80f3ee80b089fca482f04788af0b9d4d17 Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Thu, 21 Feb 2013 18:47:18 -0500 Subject: Add in missing requires --- activesupport/lib/active_support/core_ext/kernel/reporting.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/core_ext/kernel/reporting.rb b/activesupport/lib/active_support/core_ext/kernel/reporting.rb index 526b8378a5..84986dff3c 100644 --- a/activesupport/lib/active_support/core_ext/kernel/reporting.rb +++ b/activesupport/lib/active_support/core_ext/kernel/reporting.rb @@ -1,4 +1,6 @@ require 'rbconfig' +require 'stringio' + module Kernel # Sets $VERBOSE to nil for the duration of the block and back to its original value afterwards. # -- cgit v1.2.3 From 7cc26fd15e27c4a13705a844538bebfdd0461729 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Tue, 20 Mar 2012 09:58:42 -0700 Subject: search private and protected methods for convert_key --- activesupport/lib/active_support/core_ext/hash/indifferent_access.rb | 1 - activesupport/lib/active_support/core_ext/hash/slice.rb | 4 ++-- activesupport/lib/active_support/hash_with_indifferent_access.rb | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb b/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb index 7d54c9fae6..e5042c6c18 100644 --- a/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb +++ b/activesupport/lib/active_support/core_ext/hash/indifferent_access.rb @@ -1,7 +1,6 @@ require 'active_support/hash_with_indifferent_access' class Hash - # Returns an ActiveSupport::HashWithIndifferentAccess out of its receiver: # # {:a => 1}.with_indifferent_access["a"] # => 1 diff --git a/activesupport/lib/active_support/core_ext/hash/slice.rb b/activesupport/lib/active_support/core_ext/hash/slice.rb index 0484d8e5d8..a983cae39e 100644 --- a/activesupport/lib/active_support/core_ext/hash/slice.rb +++ b/activesupport/lib/active_support/core_ext/hash/slice.rb @@ -13,7 +13,7 @@ class Hash # valid_keys = [:mass, :velocity, :time] # search(options.slice(*valid_keys)) def slice(*keys) - keys = keys.map! { |key| convert_key(key) } if respond_to?(:convert_key) + keys = keys.map! { |key| convert_key(key) } if respond_to?(:convert_key, true) hash = self.class.new keys.each { |k| hash[k] = self[k] if has_key?(k) } hash @@ -23,7 +23,7 @@ class Hash # Returns a hash contained the removed key/value pairs # {:a => 1, :b => 2, :c => 3, :d => 4}.slice!(:a, :b) # => {:c => 3, :d => 4} def slice!(*keys) - keys = keys.map! { |key| convert_key(key) } if respond_to?(:convert_key) + keys = keys.map! { |key| convert_key(key) } if respond_to?(:convert_key, true) omit = slice(*self.keys - keys) hash = slice(*keys) replace(hash) diff --git a/activesupport/lib/active_support/hash_with_indifferent_access.rb b/activesupport/lib/active_support/hash_with_indifferent_access.rb index 9e7cb76307..9dc93de5a9 100644 --- a/activesupport/lib/active_support/hash_with_indifferent_access.rb +++ b/activesupport/lib/active_support/hash_with_indifferent_access.rb @@ -6,7 +6,7 @@ require 'active_support/core_ext/hash/keys' module ActiveSupport class HashWithIndifferentAccess < Hash - + # Always returns true, so that Array#extract_options! finds members of this class. def extractable_options? true -- cgit v1.2.3 From 0190dcae3c7d4dba5d8b322c04236feea22fc0f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Mon, 5 Nov 2012 15:12:09 -0200 Subject: Make the tests pass with minitest 4.2 --- activesupport/test/test_case_test.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'activesupport') diff --git a/activesupport/test/test_case_test.rb b/activesupport/test/test_case_test.rb index c4653b1ae6..ab74d579fc 100644 --- a/activesupport/test/test_case_test.rb +++ b/activesupport/test/test_case_test.rb @@ -16,6 +16,9 @@ module ActiveSupport def options nil end + + def record(*args) + end end if defined?(MiniTest::Assertions) && TestCase < MiniTest::Assertions -- cgit v1.2.3 From 5693d444686d84d403de5af5d3e23ffe8147001d Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 6 Oct 2012 20:57:22 -0700 Subject: Ruby 2 compat. Hash[] now raises on bad elements rather than ignoring them. No sense over-testing this MRI-specific behavior. See ruby/ruby@8d6add973ebcb3b4c1efbfaf07786550a3e219af --- activesupport/test/ordered_hash_test.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/test/ordered_hash_test.rb b/activesupport/test/ordered_hash_test.rb index 0b5f912dc4..a7fd9402c8 100644 --- a/activesupport/test/ordered_hash_test.rb +++ b/activesupport/test/ordered_hash_test.rb @@ -221,7 +221,6 @@ class OrderedHashTest < Test::Unit::TestCase alternate = ActiveSupport::OrderedHash[ [ [1, 2], [3, 4], - "bad key value pair", [ 'missing value' ] ]] -- cgit v1.2.3 From 8598633cc1d5ea402f8b49b1f71cd92180cc1138 Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Fri, 22 Feb 2013 17:29:08 -0500 Subject: Do not redirect cache logger to /dev/null in test For some reason, redirecting cache's logger to '/dev/null' resulting in a test failures and LoadError. I think it's because of Thread issue. Instead of trying to make every logger threadsafe for Rails 3.2, I think it's better to just don't set the logger for now. (Note: resetting the logger back to original value in the teardown block didn't fix the problem.) --- activesupport/test/caching_test.rb | 1 - 1 file changed, 1 deletion(-) (limited to 'activesupport') diff --git a/activesupport/test/caching_test.rb b/activesupport/test/caching_test.rb index c4c753caed..6db1746672 100644 --- a/activesupport/test/caching_test.rb +++ b/activesupport/test/caching_test.rb @@ -690,7 +690,6 @@ uses_memcached 'memcached backed store' do @data = @cache.instance_variable_get(:@data) @cache.clear @cache.silence! - @cache.logger = Logger.new("/dev/null") end include CacheStoreBehavior -- cgit v1.2.3 From 621b5b7f0e608bc916a66a6e046f11485317949c Mon Sep 17 00:00:00 2001 From: SHIBATA Hiroshi Date: Sat, 29 Dec 2012 14:07:09 +0900 Subject: added marshal_load and marshal_dump for ProxyTestResult. Behavior of method_missing with Marshal.dump and Marshal.load is changing in ruby 2.0.0 later. --- activesupport/lib/active_support/testing/isolation.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'activesupport') diff --git a/activesupport/lib/active_support/testing/isolation.rb b/activesupport/lib/active_support/testing/isolation.rb index 6b29ba4c10..77c04758ba 100644 --- a/activesupport/lib/active_support/testing/isolation.rb +++ b/activesupport/lib/active_support/testing/isolation.rb @@ -12,8 +12,8 @@ module ActiveSupport end class ProxyTestResult - def initialize - @calls = [] + def initialize(calls = []) + @calls = calls end def add_error(e) @@ -27,6 +27,14 @@ module ActiveSupport end end + def marshal_dump + @calls + end + + def marshal_load(calls) + initialize(calls) + end + def method_missing(name, *args) @calls << [name, args] end -- cgit v1.2.3