diff options
-rw-r--r-- | test/test_mogilefs_integration.rb | 14 |
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 |