-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make the tests happy again (56 passing)
- Loading branch information
Showing
5 changed files
with
45 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,57 +28,57 @@ describe('index.js', function () { | |
var fixture = util.getFixture('email_iphone.txt'); | ||
var email = replyParser(fixture, true); | ||
|
||
assert.equal(email, 'Here is another email', 'Visible text is incorrect'); | ||
assert.equal(email, 'Here is another email\n', 'Visible text is incorrect'); | ||
}); | ||
|
||
it('should process sent from Blackberry messages', function () { | ||
var fixture = util.getFixture('email_blackberry.txt'); | ||
var email = replyParser(fixture, true); | ||
|
||
assert.equal(email, 'Here is another email', 'Visible text is incorrect'); | ||
assert.equal(email, 'Here is another email\n', 'Visible text is incorrect'); | ||
}); | ||
|
||
it('should process sent from multiword device messages', function () { | ||
var fixture = util.getFixture('email_multi_word_sent_from_my_mobile_device.txt'); | ||
var email = replyParser(fixture, true); | ||
|
||
assert.equal(email, 'Here is another email', 'Visible text is incorrect'); | ||
assert.equal(email, 'Here is another email\n', 'Visible text is incorrect'); | ||
}); | ||
|
||
it('should process sent from not a signature message', function () { | ||
var fixture = util.getFixture('email_sent_from_my_not_signature.txt'); | ||
var email = replyParser(fixture, true); | ||
|
||
assert.equal(email, 'Here is another email\n\nSent from my desk, is much easier then my mobile phone.', 'Visible text is incorrect'); | ||
assert.equal(email, 'Here is another email\n\nSent from my desk, is much easier then my mobile phone.\n', 'Visible text is incorrect'); | ||
}); | ||
|
||
it('should find just the top part of an Outlook message', function () { | ||
var fixture = util.getFixture('email_2_1.txt'); | ||
var email = replyParser(fixture, true); | ||
|
||
assert.equal(email, 'Outlook with a reply', 'Visible text is incorrect'); | ||
assert.equal(email, 'Outlook with a reply\n\n', 'Visible text is incorrect'); | ||
}); | ||
|
||
it('should retain bullets', function () { | ||
var fixture = util.getFixture('email_bullets.txt'); | ||
var email = replyParser(fixture, true); | ||
|
||
assert.equal(email, 'test 2 this should list second\n\nand have spaces\n\nand retain this formatting\n\n\n - how about bullets\n - and another', 'Visible text is incorrect'); | ||
assert.equal(email, 'test 2 this should list second\n\nand have spaces\n\nand retain this formatting\n\n\n - how about bullets\n - and another\n\n', 'Visible text is incorrect'); | ||
}); | ||
|
||
it('should parse unquoted reply', function () { | ||
var fixture = util.getFixture('email_unquoted_reply.txt'); | ||
var email = replyParser(fixture, true); | ||
|
||
assert.equal(email, 'This is my reply.', 'Visible text is incorrect'); | ||
assert.equal(email, 'This is my reply.\n', 'Visible text is incorrect'); | ||
}); | ||
|
||
it('should preserve newlines in email threads', function () { | ||
var fixture = util.getFixture('email_thread.txt'); | ||
var email = replyParser(fixture); | ||
|
||
var expectedText = | ||
"On Nov 21, 2014, at 10:18, John Doe <[email protected]> wrote:\n" + | ||
"On Nov 21, 2014, at 10:18, John Doe <[email protected]> wrote:\n\n" + | ||
"> Ok. Thanks.\n" + | ||
">\n" + | ||
"> On Nov 21, 2014, at 9:26, Jim Beam <[email protected]> wrote:\n" + | ||
|
@@ -93,7 +93,7 @@ describe('index.js', function () { | |
">> --\n" + | ||
">> Jim Beam – Acme Corp\n" + | ||
">>\n" + | ||
">\n"; | ||
">"; | ||
|
||
assert.equal(email.getFragments()[1].getContent(), expectedText, 'Second fragment is incorrect'); | ||
}); | ||
|
@@ -106,21 +106,21 @@ describe('index.js', function () { | |
"Hi,\n" + | ||
"You can list the keys for the bucket and call delete for each. Or if you\n" + | ||
"put the keys (and kept track of them in your test) you can delete them\n" + | ||
"one at a time (without incurring the cost of calling list first.)\n" + | ||
"Something like:\n" + | ||
"one at a time (without incurring the cost of calling list first.)\n\n" + | ||
"Something like:\n\n" + | ||
" String bucket = \"my_bucket\";\n" + | ||
" BucketResponse bucketResponse = riakClient.listBucket(bucket);\n" + | ||
" RiakBucketInfo bucketInfo = bucketResponse.getBucketInfo();\n" + | ||
" RiakBucketInfo bucketInfo = bucketResponse.getBucketInfo();\n\n" + | ||
" for(String key : bucketInfo.getKeys()) {\n" + | ||
" riakClient.delete(bucket, key);\n" + | ||
" }\n" + | ||
"would do it.\n" + | ||
"See also\n" + | ||
"http://wiki.basho.com/REST-API.html#Bucket-operations\n" + | ||
"which says\n" + | ||
" }\n\n\n" + | ||
"would do it.\n\n" + | ||
"See also\n\n" + | ||
"http://wiki.basho.com/REST-API.html#Bucket-operations\n\n" + | ||
"which says\n\n" + | ||
"\"At the moment there is no straightforward way to delete an entire\n" + | ||
"Bucket. There is, however, an open ticket for the feature. To delete all\n" + | ||
"the keys in a bucket, you’ll need to delete them all individually.\"\n"; | ||
"the keys in a bucket, you’ll need to delete them all individually.\""; | ||
|
||
assert.equal(email.getVisibleText(), expectedText, 'Did not get expected visible body'); | ||
}); | ||
|
@@ -133,21 +133,21 @@ describe('index.js', function () { | |
"Hi,\n" + | ||
"You can list the keys for the bucket and call delete for each. Or if you\n" + | ||
"put the keys (and kept track of them in your test) you can delete them\n" + | ||
"one at a time (without incurring the cost of calling list first.)\n" + | ||
"Something like:\n" + | ||
"one at a time (without incurring the cost of calling list first.)\n\n" + | ||
"Something like:\n\n" + | ||
" String bucket = \"my_bucket\";\n" + | ||
" BucketResponse bucketResponse = riakClient.listBucket(bucket);\n" + | ||
" RiakBucketInfo bucketInfo = bucketResponse.getBucketInfo();\n" + | ||
" RiakBucketInfo bucketInfo = bucketResponse.getBucketInfo();\n\n" + | ||
" for(String key : bucketInfo.getKeys()) {\n" + | ||
" riakClient.delete(bucket, key);\n" + | ||
" }\n" + | ||
"would do it.\n" + | ||
"See also\n" + | ||
"http://wiki.basho.com/REST-API.html#Bucket-operations\n" + | ||
"which says\n" + | ||
" }\n\n\n" + | ||
"would do it.\n\n" + | ||
"See also\n\n" + | ||
"http://wiki.basho.com/REST-API.html#Bucket-operations\n\n" + | ||
"which says\n\n" + | ||
"\"At the moment there is no straightforward way to delete an entire\n" + | ||
"Bucket. There is, however, an open ticket for the feature. To delete all\n" + | ||
"the keys in a bucket, you’ll need to delete them all individually.\"\n"; | ||
"the keys in a bucket, you’ll need to delete them all individually.\""; | ||
|
||
assert.equal(email, expectedText, 'Did not get expected visible body'); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ bonjour, | |
je n'ai pas eu de retour sur ma précision.. | ||
merci d'avance | ||
|
||
De : Someone Somewhere <[email protected]> | ||
De : Someone Somewhere <[email protected]> | ||
À : mycompany <[email protected]> | ||
Envoyé le : Mercredi 30 novembre 2016 10h30 | ||
Objet : Re: Vous avez reçu une réponse à votre question ! | ||
|