about summary refs log tree commit homepage
path: root/test/test_mogilefs_integration.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_mogilefs_integration.rb')
-rw-r--r--test/test_mogilefs_integration.rb37
1 files changed, 13 insertions, 24 deletions
diff --git a/test/test_mogilefs_integration.rb b/test/test_mogilefs_integration.rb
index 4882cce..3c79308 100644
--- a/test/test_mogilefs_integration.rb
+++ b/test/test_mogilefs_integration.rb
@@ -47,10 +47,8 @@ class TestMogileFSIntegration < TestMogIntegration
       w.close
     end
     assert_equal data.size, @client.store_file("pipe", nil, r)
-    assert_nothing_raised do
-      r.close
-      th.join
-    end
+    r.close
+    th.join
     assert_equal(data, @client.get_file_data("pipe"))
 
     cbk = MogileFS::Util::StoreContent.new(nil) do |write_callback|
@@ -177,19 +175,19 @@ class TestMogileFSIntegration < TestMogIntegration
 
   def test_new_file_no_block
     rv = @client.new_file("no_block")
-    assert_nothing_raised { rv.write "HELLO" }
+    rv.write "HELLO"
     assert_nil rv.close
     assert_equal "HELLO", @client.get_file_data("no_block")
   end
 
   def test_new_file_known_content_length
     rv = @client.new_file("a", :content_length => 5)
-    assert_nothing_raised { rv.write "HELLO" }
+    rv.write "HELLO"
     assert_nil rv.close
     assert_equal "HELLO", @client.get_file_data("a")
 
     rv = @client.new_file("a", :content_length => 6)
-    assert_nothing_raised { rv.write "GOOD" }
+    rv.write "GOOD"
     assert_raises(MogileFS::SizeMismatchError) { rv.close }
     assert_equal "HELLO", @client.get_file_data("a")
 
@@ -204,19 +202,18 @@ class TestMogileFSIntegration < TestMogIntegration
     r, w = IO.pipe
     b64digest = [ Digest::MD5.digest("HELLO") ].pack('m').strip
     rv = @client.new_file("a", :content_md5 => b64digest, :content_length => 5)
-    assert_nothing_raised { rv.write "HELLO" }
+    rv.write "HELLO"
     assert_nil rv.close
     assert_equal "HELLO", @client.get_file_data("a")
 
-    assert_nothing_raised { w.write "HIHI"; w.close }
+    w.write "HIHI"
+    w.close
     assert_raises(ArgumentError) do
       @client.new_file("a", :content_md5 => b64digest) { |f| f.big_io = r }
     end
     assert_equal "HELLO", @client.get_file_data("a")
 
-    assert_nothing_raised do
-      @client.new_file("a", :content_md5 => :trailer) { |f| f.big_io = r }
-    end
+    @client.new_file("a", :content_md5 => :trailer) { |f| f.big_io = r }
     assert_equal "HIHI", @client.get_file_data("a")
 
     # legacy, in case anybody used it
@@ -241,9 +238,7 @@ class TestMogileFSIntegration < TestMogIntegration
 
   def test_store_content_opts
     b64digest = [ Digest::MD5.digest("HELLO") ].pack('m').strip
-    assert_nothing_raised do
-      @client.store_content("c", nil, "HELLO", :content_md5 => b64digest)
-    end
+    @client.store_content("c", nil, "HELLO", :content_md5 => b64digest)
     assert_raises(MogileFS::SizeMismatchError) do
       @client.store_content("c", nil, "GOODBYE", :content_length => 2)
     end
@@ -253,9 +248,7 @@ class TestMogileFSIntegration < TestMogIntegration
   def test_store_file_opts
     b64digest = [ Digest::MD5.digest("HELLO") ].pack('m').strip
     io = StringIO.new("HELLO")
-    assert_nothing_raised do
-      @client.store_file("c", nil, io, :content_md5 => b64digest)
-    end
+    @client.store_file("c", nil, io, :content_md5 => b64digest)
 
     io = StringIO.new("GOODBYE")
     assert_raises(MogileFS::SizeMismatchError) do
@@ -271,9 +264,7 @@ class TestMogileFSIntegration < TestMogIntegration
       [ 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
+    @client.store_file("c", nil, io, :content_md5 => expect_md5)
 
     assert_equal true, checked, "expect_md5 lambda called"
   end
@@ -284,9 +275,7 @@ class TestMogileFSIntegration < TestMogIntegration
     tmp.sync = true
     tmp.write "HIHI"
     tmp.rewind
-    assert_nothing_raised do
-      @client.store_file("unlinked", nil, tmp)
-    end
+    @client.store_file("unlinked", nil, tmp)
 
     assert_equal "HIHI", @client.get_file_data("unlinked")
   end