test/test_file.rb in mime_builder-0.0.3 vs test/test_file.rb in mime_builder-0.0.4

- old
+ new

@@ -19,12 +19,12 @@ assert_equal 'attachment; filename="test_file.pdf"', filepart.get_attachment_content_disposition(filename) assert_equal 'attachment; filename="test_file.pdf"', filepart.get_attachment_content_disposition(filepath) end def test_base64 - filepath = './test/test_file.pdf' filename = 'test_file.pdf' + filepath = File.join './test', filename filepart = MIMEBuilder::Filepath.new(filepath, {:base64_encode => true}) assert_equal 'application/pdf', filepart.get_file_content_type(filepath) assert_equal 'application/pdf', filepart.mime.headers.get('Content-Type') @@ -45,21 +45,21 @@ assert_equal 'attachment; filename="test_file.pdf"', filepart.get_attachment_content_disposition(filename) assert_equal 'attachment; filename="test_file.pdf"', filepart.get_attachment_content_disposition(filepath) end def test_attachment - filepath = './test/test_file.pdf' filename = 'test_file.pdf' + filepath = File.join './test', filename filepart = MIMEBuilder::Filepath.new(filepath, {:is_attachment => true}) assert_equal 'attachment; filename="test_file.pdf"', filepart.mime.headers.get('Content-Disposition') end def test_nonexistent_file filepath = './test/test_file_nonexistent.pdf' assert_raise do - filepart = MIMEBuilder::Filepath.new(filepath) + MIMEBuilder::Filepath.new(filepath) end end end \ No newline at end of file