diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-04 14:09:16 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-01-04 15:07:15 -0800 |
commit | b1dc9c004e0e81fe69416c117bcc04d2cbd2c83c (patch) | |
tree | 7d35f5c8bd9ba4e735b7cce4935eba996bb6876f | |
parent | a8a704b07c1d2303e8e55777e249a6adf0ec4484 (diff) | |
download | rails-b1dc9c004e0e81fe69416c117bcc04d2cbd2c83c.tar.gz rails-b1dc9c004e0e81fe69416c117bcc04d2cbd2c83c.tar.bz2 rails-b1dc9c004e0e81fe69416c117bcc04d2cbd2c83c.zip |
use dots for method calls
-rw-r--r-- | activesupport/test/ordered_hash_test.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/activesupport/test/ordered_hash_test.rb b/activesupport/test/ordered_hash_test.rb index 72088854fc..69f24dd6f8 100644 --- a/activesupport/test/ordered_hash_test.rb +++ b/activesupport/test/ordered_hash_test.rb @@ -239,14 +239,14 @@ class OrderedHashTest < Test::Unit::TestCase def test_each_after_yaml_serialization values = [] - @deserialized_ordered_hash = YAML::load(YAML::dump(@ordered_hash)) + @deserialized_ordered_hash = YAML.load(YAML.dump(@ordered_hash)) @deserialized_ordered_hash.each {|key, value| values << value} assert_equal @values, values end def test_order_after_yaml_serialization - @deserialized_ordered_hash = YAML::load(YAML::dump(@ordered_hash)) + @deserialized_ordered_hash = YAML.load(YAML.dump(@ordered_hash)) assert_equal @keys, @deserialized_ordered_hash.keys assert_equal @values, @deserialized_ordered_hash.values @@ -255,12 +255,17 @@ class OrderedHashTest < Test::Unit::TestCase def test_order_after_yaml_serialization_with_nested_arrays @ordered_hash[:array] = %w(a b c) - @deserialized_ordered_hash = YAML::load(YAML::dump(@ordered_hash)) + @deserialized_ordered_hash = YAML.load(YAML.dump(@ordered_hash)) assert_equal @ordered_hash.keys, @deserialized_ordered_hash.keys assert_equal @ordered_hash.values, @deserialized_ordered_hash.values end + def test_has_yaml_tag + @ordered_hash[:array] = %w(a b c) + assert_match '!omap', YAML.dump(@ordered_hash) + end + def test_update_sets_keys @updated_ordered_hash = ActiveSupport::OrderedHash.new @updated_ordered_hash.update(:name => "Bob") |