Sha256: 604f83ebfdf97c788dd1e9fb4d2f19fd366fe16085f52012fffc659b9674b6db

Contents?: true

Size: 538 Bytes

Versions: 2

Compression:

Stored size: 538 Bytes

Contents

require_relative "test_helper"
require "message_queue/options_helper"

class OptionsHelperTest < Test::Unit::TestCase
  class TestClass
    include OptionsHelper
  end

  def test_deep_clone
    hash = {:foo => :bar}

    obj = TestClass.new
    new_hash = obj.deep_clone(hash)
    assert_equal new_hash, hash

    hash[:foo] = :baz
    assert_not_equal new_hash, hash

    hash_with_block = {:foo => { :bar => ->() {:baz} } }
    new_hash = obj.deep_clone(hash_with_block)
    assert_equal new_hash, {:foo => { :bar => :baz }}
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
message_queue-0.1.1 test/options_helper_test.rb
message_queue-0.1.0 test/options_helper_test.rb