[前][次][番号順一覧][スレッド一覧]

ruby-changes:31674

From: zzak <ko1@a...>
Date: Thu, 21 Nov 2013 16:51:35 +0900 (JST)
Subject: [ruby-changes:31674] zzak:r43753 (trunk): * test/digest/test_digest.rb: Add more tests for digest/bubblebabble

zzak	2013-11-21 16:51:29 +0900 (Thu, 21 Nov 2013)

  New Revision: 43753

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43753

  Log:
    * test/digest/test_digest.rb: Add more tests for digest/bubblebabble

  Modified files:
    trunk/ChangeLog
    trunk/test/digest/test_digest.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 43752)
+++ ChangeLog	(revision 43753)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Thu Nov 21 16:50:16 2013  Zachary Scott  <e@z...>
+
+	* test/digest/test_digest.rb: Add more tests for digest/bubblebabble
+
 Thu Nov 21 16:32:47 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* lib/delegate.rb (Delegator#method_missing): try private methods defined in
Index: test/digest/test_digest.rb
===================================================================
--- test/digest/test_digest.rb	(revision 43752)
+++ test/digest/test_digest.rb	(revision 43753)
@@ -105,10 +105,22 @@ module TestDigest https://github.com/ruby/ruby/blob/trunk/test/digest/test_digest.rb#L105
   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

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]