Skip to content

Commit

Permalink
Broaden test coverage. Verify existence of output files.
Browse files Browse the repository at this point in the history
  • Loading branch information
rbrooks committed Nov 20, 2011
1 parent 28917e8 commit 7cc7102
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/converter_test.rb
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 7cc7102

Please sign in to comment.