PageRenderTime 25ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/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
Possible License(s): GPL-3.0, GPL-2.0, IPL-1.0, AGPL-1.0, LGPL-3.0
  1. require 'facets/hash/op_push'
  2. require 'test/unit'
  3. class TC_Hash_Op < Test::Unit::TestCase
  4. def test_op_push_two_element_array
  5. h = {}
  6. a = [:b, 2]
  7. r = {:b => 2}
  8. assert_equal(h, h << a)
  9. assert_equal(r, h)
  10. end
  11. def test_op_push_hash
  12. h1 = {:a => 1}
  13. h2 = {:b => 2, :c => 3 }
  14. r = { :a => 1, :b => 2, :c => 3 }
  15. assert_equal(h1, h1 << h2)
  16. assert_equal(r, h1)
  17. end
  18. end