Guest User

Untitled

a guest
May 26th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. require 'test/unit'
  2.  
  3. class FinallySaneTest < Test::Unit::TestCase
  4. def test_deep_copy
  5. complex_array = [{:blah => "hello"},{:foo => "blah"}]
  6. copied_array = Marshal.load(Marshal.dump(complex_array))
  7. copied_array[0][:blah] = nil
  8.  
  9. assert_not_equal copied_array, complex_array
  10. end
  11. end
  12.  
  13. # 1 tests, 1 assertions, 0 failures, 0 errors
Add Comment
Please, Sign In to add comment