Browse files

Broaden test coverage. Verify existence of output files.

  • Loading branch information...
1 parent 28917e8 commit 7cc71022612c9043b2e82c1606679be087846561 @iq9 committed Nov 20, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 test/converter_test.rb
View
8 test/converter_test.rb
@@ -41,6 +41,7 @@ def test_single_flac
ARGV << File.join(@temp_dir, 'test.flac')
out, = capture_io { @app.convert }
assert_match /test\.flac converted/, out
+ assert_equal File.exists?(File.join(@temp_dir, 'test.m4a')), true
end
def test_single_wav
@@ -49,6 +50,7 @@ def test_single_wav
ARGV << File.join(@temp_dir, 'test2.wav')
out, = capture_io { @app.convert }
assert_match /test2\.wav converted/, out
+ assert_equal File.exists?(File.join(@temp_dir, 'test2.m4a')), true
end
def test_mixed_directory
@@ -59,6 +61,8 @@ def test_mixed_directory
out, = capture_io { @app.convert }
assert_match /test\.flac converted/, out
assert_match /test2\.wav converted/, out
+ assert_equal File.exists?(File.join(@temp_dir, 'test.m4a')), true
+ assert_equal File.exists?(File.join(@temp_dir, 'test2.m4a')), true
end
def test_single_flac_file_exists
@@ -77,6 +81,7 @@ def test_single_flac_file_exists_force_overwrite
ARGV << '--force' << File.join(@temp_dir, 'test.flac')
out, = capture_io { @app.convert }
assert_match /test\.flac converted/, out
+ assert_equal File.exists?(File.join(@temp_dir, 'test.m4a')), true
end
def test_mixed_directory_file_exists
@@ -88,6 +93,7 @@ def test_mixed_directory_file_exists
out, err = capture_io { @app.convert }
assert_match /test\.m4a exists/, err
assert_match /test2\.wav converted/, out
+ assert_equal File.exists?(File.join(@temp_dir, 'test2.m4a')), true
end
def test_mixed_directory_file_exists_force_overwrite
@@ -99,6 +105,8 @@ def test_mixed_directory_file_exists_force_overwrite
out, = capture_io { @app.convert }
assert_match /test\.flac converted/, out
assert_match /test2\.wav converted/, out
+ assert_equal File.exists?(File.join(@temp_dir, 'test.m4a')), true
+ assert_equal File.exists?(File.join(@temp_dir, 'test2.m4a')), true
end
def test_standard_exception_handling_invalid_option

0 comments on commit 7cc7102

Please sign in to comment.