diff options
author | lholden <lholden@yellowpages.com> | 2009-01-21 16:17:24 -0800 |
---|---|---|
committer | lholden <lholden@yellowpages.com> | 2009-01-21 16:17:24 -0800 |
commit | 19f8bb2808316dfca1f009538c3505ba144f614b (patch) | |
tree | 1ab9e925e83b988ed2a1858aa19236e2bcd79a60 /activesupport/test/ordered_hash_test.rb | |
parent | b8fadd708b9850a77e1f64038763fffcff502499 (diff) | |
parent | 73cc5f270a5c2a2eab76c6c02615fec608822494 (diff) | |
download | rails-19f8bb2808316dfca1f009538c3505ba144f614b.tar.gz rails-19f8bb2808316dfca1f009538c3505ba144f614b.tar.bz2 rails-19f8bb2808316dfca1f009538c3505ba144f614b.zip |
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'activesupport/test/ordered_hash_test.rb')
-rw-r--r-- | activesupport/test/ordered_hash_test.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/activesupport/test/ordered_hash_test.rb b/activesupport/test/ordered_hash_test.rb index 0e2aa4543d..fb76ca1ab6 100644 --- a/activesupport/test/ordered_hash_test.rb +++ b/activesupport/test/ordered_hash_test.rb @@ -98,7 +98,8 @@ class OrderedHashTest < Test::Unit::TestCase end def test_delete_if - (copy = @ordered_hash.dup).delete('pink') + copy = @ordered_hash.dup + copy.delete('pink') assert_equal copy, @ordered_hash.delete_if { |k, _| k == 'pink' } assert !@ordered_hash.keys.include?('pink') end @@ -115,6 +116,7 @@ class OrderedHashTest < Test::Unit::TestCase new_ordered_hash = @ordered_hash.reject { |k, _| k == 'pink' } assert_equal copy, @ordered_hash assert !new_ordered_hash.keys.include?('pink') + assert @ordered_hash.keys.include?('pink') end def test_clear @@ -140,4 +142,10 @@ class OrderedHashTest < Test::Unit::TestCase assert_equal [@keys.first, @values.first], pair assert !@ordered_hash.keys.include?(pair.first) end + + def test_keys + original = @ordered_hash.keys.dup + @ordered_hash.keys.pop + assert_equal original, @ordered_hash.keys + end end
\ No newline at end of file |