summaryrefslogtreecommitdiff
path: root/test/digest
diff options
context:
space:
mode:
authorzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-21 07:51:29 +0000
committerzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-21 07:51:29 +0000
commit671dbfdda8b132db3f5379c9f5506b0b2fceb4a5 (patch)
tree2a364e8242f112d9a839256c6efb430980532275 /test/digest
parent594eec5b7d2ca6ae1c8473b570af312dd49c40b5 (diff)
* test/digest/test_digest.rb: Add more tests for digest/bubblebabble
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43753 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/digest')
-rwxr-xr-xtest/digest/test_digest.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/digest/test_digest.rb b/test/digest/test_digest.rb
index 36a8635..3e7f850 100755
--- a/test/digest/test_digest.rb
+++ b/test/digest/test_digest.rb
@@ -105,10 +105,22 @@ module TestDigest
end
def test_bubblebabble
+ expected = "xirek-hasol-fumik-lanax"
+ assert_equal Digest.bubblebabble('message'), expected
+ end
+
+ def test_bubblebabble_class
expected = "xopoh-fedac-fenyh-nehon-mopel-nivor-lumiz-rypon-gyfot-cosyz-rimez-lolyv-pekyz-rosud-ricob-surac-toxox"
assert_equal Digest::SHA256.bubblebabble('message'), expected
end
+ def test_bubblebabble_instance
+ expected = "xumor-boceg-dakuz-sulic-gukoz-rutas-mekek-zovud-gunap-vabov-genin-rygyg-sanun-hykac-ruvah-dovah-huxex"
+
+ hash = Digest::SHA256.new
+ assert_equal hash.bubblebabble, expected
+ end
+
class TestMD5 < Test::Unit::TestCase
include TestDigest
ALGO = Digest::MD5