Sha256: a569c31ce22bff8117f209075e4edd920e3d2f621f60c35e9a5dc45556d7bb1a

Contents?: true

Size: 1.06 KB

Versions: 1

Compression:

Stored size: 1.06 KB

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facet/crypt.rb
#
# Extracted Wed Jan 25 10:52:51 EST 2006
# Unit Tools Reap Test Extractor
#

require 'facet/crypt.rb'


  require "test/unit"

  class CryptTest < Test::Unit::TestCase

    def array_test(arr, algo)
      arr.each do |password, hash|
        assert(Crypt.check(password, hash, algo))
      end
    end

    def test_md5
      a = [ [' ', '$1$yiiZbNIH$YiCsHZjcTkYd31wkgW8JF.'],
        ['pass', '$1$YeNsbWdH$wvOF8JdqsoiLix754LTW90'],
        ['____fifteen____', '$1$s9lUWACI$Kk1jtIVVdmT01p0z3b/hw1'],
        ['____sixteen_____', '$1$dL3xbVZI$kkgqhCanLdxODGq14g/tW1'],
        ['____seventeen____', '$1$NaH5na7J$j7y8Iss0hcRbu3kzoJs5V.'],
        ['__________thirty-three___________', '$1$HO7Q6vzJ$yGwp2wbL5D7eOVzOmxpsy.'],
        ['apache', '$apr1$J.w5a/..$IW9y6DR0oO/ADuhlMF5/X1']
      ] 
      array_test(a, :md5)
    end

    def test_bad_algo
      assert_raise(ArgumentError) do 
        Crypt.crypt("qsdf", :qsdf)
      end
    end

  end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-1.0.3 packages/more/test/lib/facet/test_crypt.rb