aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/test/ordered_hash_test.rb
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2016-08-06 19:38:33 +0200
committerXavier Noria <fxn@hashref.com>2016-08-06 19:38:33 +0200
commit5c315a8fa6296904f5e0ba8da919fc395548cf98 (patch)
treec20da9c73b5db9caa8c2aa711955ed17f01d396d /activesupport/test/ordered_hash_test.rb
parentd22e522179c1c90e658c3ed0e9b972ec62306209 (diff)
downloadrails-5c315a8fa6296904f5e0ba8da919fc395548cf98.tar.gz
rails-5c315a8fa6296904f5e0ba8da919fc395548cf98.tar.bz2
rails-5c315a8fa6296904f5e0ba8da919fc395548cf98.zip
modernizes hash syntax in activesupport
Diffstat (limited to 'activesupport/test/ordered_hash_test.rb')
-rw-r--r--activesupport/test/ordered_hash_test.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/test/ordered_hash_test.rb b/activesupport/test/ordered_hash_test.rb
index 85abfa5002..f7977b276b 100644
--- a/activesupport/test/ordered_hash_test.rb
+++ b/activesupport/test/ordered_hash_test.rb
@@ -166,7 +166,7 @@ class OrderedHashTest < ActiveSupport::TestCase
hash = ActiveSupport::OrderedHash.new
hash[:a] = 0
hash[:b] = 0
- merged = hash.merge(:b => 2, :c => 7) do |key, old_value, new_value|
+ merged = hash.merge(b: 2, c: 7) do |key, old_value, new_value|
new_value + 1
end
@@ -179,7 +179,7 @@ class OrderedHashTest < ActiveSupport::TestCase
hash = ActiveSupport::OrderedHash.new
hash[:a] = 0
hash[:b] = 0
- hash.merge!(:a => 1, :c => 7) do |key, old_value, new_value|
+ hash.merge!(a: 1, c: 7) do |key, old_value, new_value|
new_value + 3
end
@@ -242,7 +242,7 @@ class OrderedHashTest < ActiveSupport::TestCase
end
def test_nested_under_indifferent_access
- flash = {:a => ActiveSupport::OrderedHash[:b, 1, :c, 2]}.with_indifferent_access
+ flash = {a: ActiveSupport::OrderedHash[:b, 1, :c, 2]}.with_indifferent_access
assert_kind_of ActiveSupport::OrderedHash, flash[:a]
end
@@ -305,7 +305,7 @@ class OrderedHashTest < ActiveSupport::TestCase
def test_update_sets_keys
@updated_ordered_hash = ActiveSupport::OrderedHash.new
- @updated_ordered_hash.update(:name => "Bob")
+ @updated_ordered_hash.update(name: "Bob")
assert_equal [:name], @updated_ordered_hash.keys
end