aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test
diff options
context:
space:
mode:
authorEmilio Tagua <miloops@gmail.com>2010-12-20 11:23:07 -0300
committerEmilio Tagua <miloops@gmail.com>2010-12-20 11:23:07 -0300
commit02fc6fbccdd3345e95592cc14e7855e2f1ea14b3 (patch)
treeb26b91e2b2fad62ec382c9cee4ca2ac318f09257 /activesupport/test
parent2ba06b48defaca940e7c878724e2fb1c090eaa92 (diff)
parent0cbfd6c28d327304432f7d0c067662b5c1e41a78 (diff)
downloadrails-02fc6fbccdd3345e95592cc14e7855e2f1ea14b3.tar.gz
rails-02fc6fbccdd3345e95592cc14e7855e2f1ea14b3.tar.bz2
rails-02fc6fbccdd3345e95592cc14e7855e2f1ea14b3.zip
Merge remote branch 'rails/master' into identity_map
Conflicts: activerecord/lib/active_record/associations/association_proxy.rb activerecord/lib/active_record/autosave_association.rb activerecord/lib/active_record/base.rb activerecord/lib/active_record/persistence.rb
Diffstat (limited to 'activesupport/test')
-rw-r--r--activesupport/test/core_ext/class/class_inheritable_attributes_test.rb5
-rw-r--r--activesupport/test/core_ext/hash_ext_test.rb8
-rw-r--r--activesupport/test/core_ext/module/synchronization_test.rb1
3 files changed, 14 insertions, 0 deletions
diff --git a/activesupport/test/core_ext/class/class_inheritable_attributes_test.rb b/activesupport/test/core_ext/class/class_inheritable_attributes_test.rb
index b284e5ee1c..020dfce56a 100644
--- a/activesupport/test/core_ext/class/class_inheritable_attributes_test.rb
+++ b/activesupport/test/core_ext/class/class_inheritable_attributes_test.rb
@@ -3,9 +3,14 @@ require 'active_support/core_ext/class/inheritable_attributes'
class ClassInheritableAttributesTest < Test::Unit::TestCase
def setup
+ ActiveSupport::Deprecation.silenced = true
@klass = Class.new
end
+ def teardown
+ ActiveSupport::Deprecation.silenced = false
+ end
+
def test_reader_declaration
assert_nothing_raised do
@klass.class_inheritable_reader :a
diff --git a/activesupport/test/core_ext/hash_ext_test.rb b/activesupport/test/core_ext/hash_ext_test.rb
index 370f26b0d7..74223dd7f2 100644
--- a/activesupport/test/core_ext/hash_ext_test.rb
+++ b/activesupport/test/core_ext/hash_ext_test.rb
@@ -12,6 +12,9 @@ class HashExtTest < Test::Unit::TestCase
class SubclassingArray < Array
end
+ class SubclassingHash < Hash
+ end
+
def setup
@strings = { 'a' => 1, 'b' => 2 }
@symbols = { :a => 1, :b => 2 }
@@ -105,6 +108,11 @@ class HashExtTest < Test::Unit::TestCase
assert_equal @strings, @mixed.with_indifferent_access.dup.stringify_keys!
end
+ def test_hash_subclass
+ flash = { "foo" => SubclassingHash.new.tap { |h| h["bar"] = "baz" } }.with_indifferent_access
+ assert_kind_of SubclassingHash, flash["foo"]
+ end
+
def test_indifferent_assorted
@strings = @strings.with_indifferent_access
@symbols = @symbols.with_indifferent_access
diff --git a/activesupport/test/core_ext/module/synchronization_test.rb b/activesupport/test/core_ext/module/synchronization_test.rb
index eb850893f0..6c407e2260 100644
--- a/activesupport/test/core_ext/module/synchronization_test.rb
+++ b/activesupport/test/core_ext/module/synchronization_test.rb
@@ -1,3 +1,4 @@
+require 'thread'
require 'abstract_unit'
require 'active_support/core_ext/class/attribute_accessors'