end
def test_file_to_file
- begin
- File.unlink('tmp/foo')
- rescue Errno::ENOENT
- end
+ remove_tmp_foo
out, err = capture_subprocess_io do
assert_arv_get @@foo_manifest_locator + '/foo', 'tmp/foo'
end
end
def test_manifest_root_to_dir
- begin
- File.unlink('tmp/foo')
- rescue Errno::ENOENT
- end
+ remove_tmp_foo
out, err = capture_subprocess_io do
assert_arv_get '-r', @@foo_manifest_locator + '/', 'tmp/'
end
end
def test_display_md5sum
- begin
- File.unlink('tmp/foo')
- rescue Errno::ENOENT
- end
+ remove_tmp_foo
out, err = capture_subprocess_io do
assert_arv_get '-r', '--md5sum', @@foo_manifest_locator + '/', 'tmp/'
end
end
def test_md5sum_nowrite
- begin
- File.unlink('tmp/foo')
- rescue Errno::ENOENT
- end
+ remove_tmp_foo
out, err = capture_subprocess_io do
assert_arv_get '-n', '--md5sum', @@foo_manifest_locator + '/', 'tmp/'
end
end
def test_sha1_nowrite
+ remove_tmp_foo
out, err = capture_subprocess_io do
assert_arv_get '-n', '-r', '--hash', 'sha1', @@foo_manifest_locator+'/', 'tmp/'
end
end
def test_block_to_file
- begin
- File.unlink('tmp/foo')
- rescue Errno::ENOENT
- end
+ remove_tmp_foo
out, err = capture_subprocess_io do
assert_arv_get @@foo_manifest_locator, 'tmp/foo'
end
def foo_manifest
". #{Digest::MD5.hexdigest('foo')}+3 0:3:foo\n"
end
+
+ def remove_tmp_foo
+ begin
+ File.unlink('tmp/foo')
+ rescue Errno::ENOENT
+ end
+ end
end