Sha256: 7d3cb799688ea5eedb562617390b61e0b1f300a7b38b0d93f70f3b17b863c064

Contents?: true

Size: 704 Bytes

Versions: 10

Compression:

Stored size: 704 Bytes

Contents

  #  _____         _
  # |_   _|__  ___| |_
  #   | |/ _ \/ __| __|
  #   | |  __/\__ \ |
  #   |_|\___||___/\__|
  #
  # for lib/facets/hash/has_keys.rb
  #
  # Extracted Mon Sep 03 16:23:07 -0700 2007
  # w/ Test Extraction Ratchet
  #

 require 'facets/hash/has_keys.rb'



  require 'test/unit'

  class TestHashHasKeys < Test::Unit::TestCase

    # TODO Write test for Hash#diff.

    def test_has_keys?
      assert( { :a=>1,:b=>2,:c=>3 }.has_keys?(:a,:b) )
      assert( ! { :a=>1,:b=>2,:c=>3 }.has_keys?(:a,:b,:d) )
    end

    def test_has_only_keys?
      assert( { :a=>1,:b=>2,:c=>3 }.has_only_keys?(:a,:b,:c) )
      assert( ! { :a=>1,:b=>2,:c=>3 }.has_only_keys?(:a,:b) )
    end

  end



Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
facets-2.0.0 test/unit/hash/test_has_keys.rb
facets-2.0.1 test/unit/hash/test_has_keys.rb
facets-2.0.2 test/unit/hash/test_has_keys.rb
facets-2.0.4 test/unit/hash/test_has_keys.rb
facets-2.0.5 test/unit/hash/test_has_keys.rb
facets-2.1.0 test/unit/hash/test_has_keys.rb
facets-2.1.1 test/unit/hash/test_has_keys.rb
facets-2.0.3 test/unit/hash/test_has_keys.rb
facets-2.1.2 test/unit/hash/test_has_keys.rb
facets-2.1.3 test/unit/hash/test_has_keys.rb