/vendor/gems/facets-2.4.5/test/core/hash/test_swap.rb

https://bitbucket.org/mediashelf/fedora-migrator · Ruby · 11 lines · 8 code · 3 blank · 0 comment · 0 complexity · a852794dbcde12ded7fce9f40a0657dc MD5 · raw file

  1. require 'facets/hash/swap.rb'
  2. require 'test/unit'
  3. class TestHashSwap < Test::Unit::TestCase
  4. def test_swap!
  5. h = { :a=>1, :b=>2 }
  6. assert_equal( { :a=>2, :b=>1 }, h.swap!(:a, :b) )
  7. end
  8. end