diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-25 22:58:43 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-10-25 22:58:43 +0000 |
commit | b61d8b6045497a5b2185bf8cb61a381f179d3ecd (patch) | |
tree | 0b7980dd65f71136db50a788d5e5a052efdf66ed /test/rubygems/test_gem_digest.rb | |
parent | 17358af75b80343f7861907b9288607e67a08f61 (diff) | |
download | ruby-b61d8b6045497a5b2185bf8cb61a381f179d3ecd.tar.gz |
Update to RubyGems 1.3.1 r1909.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19941 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rubygems/test_gem_digest.rb')
-rwxr-xr-x | test/rubygems/test_gem_digest.rb | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/test/rubygems/test_gem_digest.rb b/test/rubygems/test_gem_digest.rb index 9d825b2796..13613c96a8 100755 --- a/test/rubygems/test_gem_digest.rb +++ b/test/rubygems/test_gem_digest.rb @@ -1,44 +1,46 @@ -#!/usr/bin/env ruby #-- # Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others. # All rights reserved. # See LICENSE.txt for permissions. #++ -require "test/unit" +require File.join(File.expand_path(File.dirname(__FILE__)), 'gemutilities') require "rubygems/digest/md5" require "rubygems/digest/sha1" require "rubygems/digest/sha2" -class TestRubygemsGemDigest < Test::Unit::TestCase +class TestRubygemsGemDigest < RubyGemTestCase + def test_sha256_hex_digest_works digester = Gem::SHA256.new assert_equal "b5d4045c3f466fa91fe2cc6abe79232a1a57cdf104f7a26e716e0a1e2789df78", digester.hexdigest("ABC") end - + def test_sha256_digest_works digester = Gem::SHA256.new - assert_equal "\265\324\004\\?Fo\251\037\342\314j\276y#*\032W\315\361\004\367\242nqn\n\036'\211\337x", + assert_equal "\265\324\004\\?Fo\251\037\342\314j\276y#*\032W\315\361\004\367\242nqn\n\036'\211\337x", digester.digest("ABC") end - + def test_sha1_hex_digest_works digester = Gem::SHA1.new assert_equal "3c01bdbb26f358bab27f267924aa2c9a03fcfdb8", digester.hexdigest("ABC") end - + def test_sha1_digest_works digester = Gem::SHA1.new assert_equal "<\001\275\273&\363X\272\262\177&y$\252,\232\003\374\375\270", digester.digest("ABC") end - + def test_md5_hex_digest_works digester = Gem::MD5.new assert_equal "902fbdd2b1df0c4f70b4a5d23525e932", digester.hexdigest("ABC") end - + def test_md5_digest_works digester = Gem::MD5.new assert_equal "\220/\275\322\261\337\fOp\264\245\3225%\3512", digester.digest("ABC") end -end
\ No newline at end of file + +end + |