From a25588c1c376be13221b0b0d0ca9f5c9200c0d75 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 7 Nov 2012 23:18:31 +0100 Subject: [PATCH] Fixed md5sum of unit test, added class to read test emails form stdin. --- app/models/channel/mail_stdin.rb | 11 +++++++++++ test/unit/email_parser_test.rb | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 app/models/channel/mail_stdin.rb diff --git a/app/models/channel/mail_stdin.rb b/app/models/channel/mail_stdin.rb new file mode 100644 index 000000000..67686904e --- /dev/null +++ b/app/models/channel/mail_stdin.rb @@ -0,0 +1,11 @@ +class Channel::MailStdin < Channel::EmailParser + include UserInfo + + def initialize + puts "read main from STDIN" + + msg = ARGF.read + + process( {}, msg ) + end +end \ No newline at end of file diff --git a/test/unit/email_parser_test.rb b/test/unit/email_parser_test.rb index 06184535a..8f7a04616 100644 --- a/test/unit/email_parser_test.rb +++ b/test/unit/email_parser_test.rb @@ -6,7 +6,7 @@ class EmailParserTest < ActiveSupport::TestCase files = [ { :data => IO.read('test/fixtures/mail1.box'), - :body_md5 => 'b57d21dcac6b05e1aa67af51a9e4c1ec', + :body_md5 => 'd62c8530fc8fd35bcff0b599db95a170', :params => { :from => 'John.Smith@example.com', :from_email => 'John.Smith@example.com', @@ -141,7 +141,7 @@ Managing Director: Martin Edenhofer :attachments => [ { :md5 => '635e03d2ddde520b925262c8ffd03234', - :filename => 'message.html', + :filename => 'message.html', }, ], :params => {