/vendor/gems/facets-2.4.5/test/core/hash/test_op_push.rb
https://bitbucket.org/mediashelf/fedora-migrator · Ruby · 23 lines · 18 code · 5 blank · 0 comment · 0 complexity · 9431bb9f90c9a719092e2c4ce28f127d MD5 · raw file
- require 'facets/hash/op_push'
- require 'test/unit'
- class TC_Hash_Op < Test::Unit::TestCase
- def test_op_push_two_element_array
- h = {}
- a = [:b, 2]
- r = {:b => 2}
- assert_equal(h, h << a)
- assert_equal(r, h)
- end
- def test_op_push_hash
- h1 = {:a => 1}
- h2 = {:b => 2, :c => 3 }
- r = { :a => 1, :b => 2, :c => 3 }
- assert_equal(h1, h1 << h2)
- assert_equal(r, h1)
- end
- end