diff options
Diffstat (limited to 'activesupport/test/ordered_hash_test.rb')
-rw-r--r-- | activesupport/test/ordered_hash_test.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/activesupport/test/ordered_hash_test.rb b/activesupport/test/ordered_hash_test.rb index 9c17145b9f..7cd8c8a8f4 100644 --- a/activesupport/test/ordered_hash_test.rb +++ b/activesupport/test/ordered_hash_test.rb @@ -4,9 +4,11 @@ class OrderedHashTest < Test::Unit::TestCase def setup @keys = %w( blue green red pink orange ) @values = %w( 000099 009900 aa0000 cc0066 cc6633 ) + @hash = Hash.new @ordered_hash = ActiveSupport::OrderedHash.new @keys.each_with_index do |key, index| + @hash[key] = @values[index] @ordered_hash[key] = @values[index] end end @@ -17,7 +19,7 @@ class OrderedHashTest < Test::Unit::TestCase end def test_access - assert @keys.zip(@values).all? { |k, v| @ordered_hash[k] == v } + assert @hash.all? { |k, v| @ordered_hash[k] == v } end def test_assignment @@ -152,4 +154,8 @@ class OrderedHashTest < Test::Unit::TestCase @ordered_hash.keys.pop assert_equal original, @ordered_hash.keys end + + def test_inspect + assert @ordered_hash.inspect.include?(@hash.inspect) + end end |