Sha256: 31d2e8b1021615abc5cc80ebdc3590b5c965a2ab66962f54c57b4d3cf5165e30

Contents?: true

Size: 319 Bytes

Versions: 4

Compression:

Stored size: 319 Bytes

Contents

require 'minitest/autorun'
require 'duck_puncher'

class HashTest < MiniTest::Unit::TestCase
  def test_seek
    my_hash = { a: 1, b: { c: 2 } }
    assert_equal my_hash.seek(:a), 1
    assert_equal my_hash.seek(:b, :a), nil
    assert_equal my_hash.seek(:b, :c), 2
    assert_equal my_hash.seek(:b), { c: 2 }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
duck_puncher-0.2.0 test/duck_puncher/hash_test.rb
duck_puncher-0.1.2 test/duck_puncher/hash_test.rb
duck_puncher-0.1.1 test/duck_puncher/hash_test.rb
duck_puncher-0.1.0 test/duck_puncher/hash_test.rb