2896: Add test file. Currently, the test only checks that arv-ws command is available...
[arvados.git] / sdk / cli / test / test_arv-put.rb
index 53f05deb716f59eb17331c37734e692603b456dc..27809aadedc0d301d458730b8e6e479d3f5fb6a0 100644 (file)
@@ -14,11 +14,10 @@ class TestArvPut < Minitest::Test
 
   def test_help
     out, err = capture_subprocess_io do
-      assert_equal(true, arv_put('-h'),
-                   'arv-put -h exits zero')
+      assert arv_put('-h'), 'arv-put -h exits zero'
     end
     $stderr.write err
-    assert_equal '', err
+    assert_empty err
     assert_match /^usage:/, out
   end
 
@@ -30,7 +29,7 @@ class TestArvPut < Minitest::Test
         w << 'foo'
       end
       w.close
-      assert_equal true, arv_put('--raw', {in: r})
+      assert arv_put('--raw', {in: r})
       r.close
       Process.waitpid wpid
     end
@@ -41,7 +40,7 @@ class TestArvPut < Minitest::Test
 
   def test_raw_file
     out, err = capture_subprocess_io do
-      assert_equal true, arv_put('--raw', './tmp/foo')
+      assert arv_put('--raw', './tmp/foo')
     end
     $stderr.write err
     assert_match '', err
@@ -50,7 +49,7 @@ class TestArvPut < Minitest::Test
 
   def test_raw_empty_file
     out, err = capture_subprocess_io do
-      assert_equal true, arv_put('--raw', './tmp/empty_file')
+      assert arv_put('--raw', './tmp/empty_file')
     end
     $stderr.write err
     assert_match '', err
@@ -63,7 +62,7 @@ class TestArvPut < Minitest::Test
                    'arv-put --filename refuses directory')
     end
     assert_match /^usage:.*error:/m, err
-    assert_equal '', out
+    assert_empty out
   end
 
   def test_filename_arg_with_multiple_files
@@ -74,12 +73,12 @@ class TestArvPut < Minitest::Test
                    'arv-put --filename refuses directory')
     end
     assert_match /^usage:.*error:/m, err
-    assert_equal '', out
+    assert_empty out
   end
 
   def test_filename_arg_with_empty_file
     out, err = capture_subprocess_io do
-      assert_equal true, arv_put('--filename', 'foo', './tmp/empty_file')
+      assert arv_put('--filename', 'foo', './tmp/empty_file')
     end
     $stderr.write err
     assert_match '', err
@@ -88,7 +87,7 @@ class TestArvPut < Minitest::Test
 
   def test_as_stream
     out, err = capture_subprocess_io do
-      assert_equal true, arv_put('--as-stream', './tmp/foo')
+      assert arv_put('--as-stream', './tmp/foo')
     end
     $stderr.write err
     assert_match '', err
@@ -97,7 +96,7 @@ class TestArvPut < Minitest::Test
 
   def test_progress
     out, err = capture_subprocess_io do
-      assert_equal true, arv_put('--manifest', '--progress', './tmp/foo')
+      assert arv_put('--manifest', '--progress', './tmp/foo')
     end
     assert_match /%/, err
     assert_equal foo_manifest_locator+"\n", out
@@ -105,7 +104,7 @@ class TestArvPut < Minitest::Test
 
   def test_batch_progress
     out, err = capture_subprocess_io do
-      assert_equal true, arv_put('--manifest', '--batch-progress', './tmp/foo')
+      assert arv_put('--manifest', '--batch-progress', './tmp/foo')
     end
     assert_match /: 0 written 3 total/, err
     assert_match /: 3 written 3 total/, err
@@ -119,7 +118,7 @@ class TestArvPut < Minitest::Test
                    'arv-put --progress --batch-progress is contradictory')
     end
     assert_match /^usage:.*error:/m, err
-    assert_equal '', out
+    assert_empty out
   end
 
   def test_read_from_implicit_stdin
@@ -138,7 +137,7 @@ class TestArvPut < Minitest::Test
         w << 'foo'
       end
       w.close
-      assert_equal true, arv_put('--filename', 'foo', specify_stdin_as,
+      assert arv_put('--filename', 'foo', specify_stdin_as,
                                  { in: r })
       r.close
       Process.waitpid wpid
@@ -169,7 +168,7 @@ class TestArvPut < Minitest::Test
       w.close
       args = []
       args.push specify_stdin_as if specify_stdin_as
-      assert_equal true, arv_put(*args, { in: r })
+      assert arv_put(*args, { in: r })
       r.close
       Process.waitpid wpid
     end