about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-12-07 01:29:43 +0000
committerEric Wong <normalperson@yhbt.net>2011-12-07 02:29:23 +0000
commitda58f47f541cff65e814a614ecff722ba2a35bf8 (patch)
tree9bb75e20cb7d41cd06ffe3bb66c800719722b372
parentd7bec4c903bd08337b7dbf4611e618762050ed58 (diff)
downloadmogilefs-client-da58f47f541cff65e814a614ecff722ba2a35bf8.tar.gz
Some applications will rely on this feature
-rw-r--r--test/test_mogilefs_integration.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/test_mogilefs_integration.rb b/test/test_mogilefs_integration.rb
index 947bb34..88657a9 100644
--- a/test/test_mogilefs_integration.rb
+++ b/test/test_mogilefs_integration.rb
@@ -255,4 +255,18 @@ class TestMogileFSIntegration < TestMogIntegration
     end
     assert_equal "HELLO", @client.get_file_data("c")
   end
+
+  def test_store_file_content_md5_lambda
+    checked = false
+    expect_md5 = lambda do
+      checked = true
+      [ Digest::MD5.digest("HELLO") ].pack('m').strip
+    end
+    io = StringIO.new("HELLO")
+    assert_nothing_raised do
+      @client.store_file("c", nil, io, :content_md5 => expect_md5)
+    end
+
+    assert_equal true, checked, "expect_md5 lambda called"
+  end
 end