Sha256: 534fecb9cea67bf6e6b82d884c7ce03a5be40694e6ea315c6aded6c4787d1896
Contents?: true
Size: 337 Bytes
Versions: 12
Compression:
Stored size: 337 Bytes
Contents
module Hash::EnsureKeys def keys?(*keys) (keys - self.keys()).empty? end end class Hash include EnsureKeys end module Hash::EnsureKeys::Etest def test_ensure_keys h = { :a => "a" } assert_equal true, h.keys?(:a) assert_equal true, h.keys? assert_equal false, h.keys?(:a, :b) end end if VEX_TEST == "base"
Version data entries
12 entries across 12 versions & 1 rubygems