summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rwxr-xr-xtest/digest/test_digest.rb12
2 files changed, 16 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index b484ca5d60..9135f4a551 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu Nov 21 16:50:16 2013 Zachary Scott <e@zzak.io>
+
+ * test/digest/test_digest.rb: Add more tests for digest/bubblebabble
+
Thu Nov 21 16:32:47 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* lib/delegate.rb (Delegator#method_missing): try private methods defined in
diff --git a/test/digest/test_digest.rb b/test/digest/test_digest.rb
index 36a8635926..3e7f850af9 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