Kensei 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/.gitignore +6 -0
  2. data/Gemfile +4 -0
  3. data/README.md +24 -0
  4. data/Rakefile +7 -0
  5. data/bin/kensei +6 -0
  6. data/kensei.gemspec +29 -0
  7. data/lib/kensei.rb +217 -0
  8. data/test/fixture/Maildir/kensei-first/All Mail/cur/1356207330_0.15143.thomanil-VirtualBox,U=1,FMD5=883ba13d52aa35908bd3344dc0604026:2,S +70 -0
  9. data/test/fixture/Maildir/kensei-first/All Mail/cur/1356207331_0.15143.thomanil-VirtualBox,U=2,FMD5=883ba13d52aa35908bd3344dc0604026:2,S +79 -0
  10. data/test/fixture/Maildir/kensei-first/All Mail/cur/1356207332_0.15143.thomanil-VirtualBox,U=3,FMD5=883ba13d52aa35908bd3344dc0604026:2,S +81 -0
  11. data/test/fixture/Maildir/kensei-first/All Mail/cur/1356207332_2.15143.thomanil-VirtualBox,U=4,FMD5=883ba13d52aa35908bd3344dc0604026:2,S +9 -0
  12. data/test/fixture/Maildir/kensei-first/All Mail/cur/1356207333_1.15143.thomanil-VirtualBox,U=5,FMD5=883ba13d52aa35908bd3344dc0604026:2,S +9 -0
  13. data/test/fixture/Maildir/kensei-first/All Mail/cur/1356207334_0.15143.thomanil-VirtualBox,U=6,FMD5=883ba13d52aa35908bd3344dc0604026:2,S +9 -0
  14. data/test/fixture/Maildir/kensei-first/All Mail/cur/1356207334_1.15143.thomanil-VirtualBox,U=9,FMD5=883ba13d52aa35908bd3344dc0604026:2,S +9 -0
  15. data/test/fixture/Maildir/kensei-first/All Mail/cur/1356207334_2.15143.thomanil-VirtualBox,U=10,FMD5=883ba13d52aa35908bd3344dc0604026:2,S +9 -0
  16. data/test/fixture/Maildir/kensei-first/All Mail/cur/1356207335_0.15143.thomanil-VirtualBox,U=11,FMD5=883ba13d52aa35908bd3344dc0604026:2,S +9 -0
  17. data/test/fixture/Maildir/kensei-first/All Mail/cur/1356207336_0.15143.thomanil-VirtualBox,U=12,FMD5=883ba13d52aa35908bd3344dc0604026:2,S +55 -0
  18. data/test/fixture/Maildir/kensei-first/All Mail/cur/1356207336_1.15143.thomanil-VirtualBox,U=13,FMD5=883ba13d52aa35908bd3344dc0604026:2,S +12 -0
  19. data/test/fixture/Maildir/kensei-first/INBOX/cur/1356207332_1.15143.thomanil-VirtualBox,U=1,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S +70 -0
  20. data/test/fixture/Maildir/kensei-first/INBOX/cur/1356207333_0.15143.thomanil-VirtualBox,U=2,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S +79 -0
  21. data/test/fixture/Maildir/kensei-first/INBOX/cur/1356207333_2.15143.thomanil-VirtualBox,U=5,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S +55 -0
  22. data/test/fixture/Maildir/kensei-first/Sent Mail/cur/1356207337_0.15143.thomanil-VirtualBox,U=1,FMD5=af48cce153be383d91f6c4a7c19fe087:2,S +9 -0
  23. data/test/fixture/Maildir/kensei-first/Sent Mail/cur/1356207337_1.15143.thomanil-VirtualBox,U=2,FMD5=af48cce153be383d91f6c4a7c19fe087:2,S +9 -0
  24. data/test/fixture/Maildir/kensei-first/Sent Mail/cur/1356207338_0.15143.thomanil-VirtualBox,U=3,FMD5=af48cce153be383d91f6c4a7c19fe087:2,S +9 -0
  25. data/test/fixture/Maildir/kensei-first/Sent Mail/cur/1356207338_1.15143.thomanil-VirtualBox,U=5,FMD5=af48cce153be383d91f6c4a7c19fe087:2,S +9 -0
  26. data/test/fixture/Maildir/kensei-first/Sent Mail/cur/1356207339_0.15143.thomanil-VirtualBox,U=6,FMD5=af48cce153be383d91f6c4a7c19fe087:2,S +9 -0
  27. data/test/fixture/Maildir/kensei-first/Sent Mail/cur/1356207339_1.15143.thomanil-VirtualBox,U=7,FMD5=af48cce153be383d91f6c4a7c19fe087:2,S +9 -0
  28. data/test/fixture/Maildir/kensei-first/Sent Mail/cur/1356207340_0.15143.thomanil-VirtualBox,U=8,FMD5=af48cce153be383d91f6c4a7c19fe087:2,S +12 -0
  29. data/test/fixture/Maildir/kensei-first/Trash/cur/1356207341_0.15143.thomanil-VirtualBox,U=1,FMD5=a7e253cd8dd95da3e20daf45519a8dc2:2,S +75 -0
  30. data/test/fixture/Maildir/kensei-first/Trash/cur/1356207341_1.15143.thomanil-VirtualBox,U=2,FMD5=a7e253cd8dd95da3e20daf45519a8dc2:2,S +9 -0
  31. data/test/fixture/Maildir/kensei-first/misc/cur/1356207342_0.15143.thomanil-VirtualBox,U=1,FMD5=bc957e26ff41470c556ee5d09e96880b:2,S +81 -0
  32. data/test/fixture/Maildir/kensei-first/security/cur/1356207343_0.15143.thomanil-VirtualBox,U=1,FMD5=e91e6348157868de9dd8b25c81aebfb9:2,S +55 -0
  33. data/test/fixture/Maildir/kenseisecond/All Mail/cur/1356207346_1.15143.thomanil-VirtualBox,U=2,FMD5=883ba13d52aa35908bd3344dc0604026:2,S +79 -0
  34. data/test/fixture/Maildir/kenseisecond/All Mail/cur/1356207346_2.15143.thomanil-VirtualBox,U=3,FMD5=883ba13d52aa35908bd3344dc0604026:2,S +81 -0
  35. data/test/fixture/Maildir/kenseisecond/All Mail/cur/1356207347_1.15143.thomanil-VirtualBox,U=4,FMD5=883ba13d52aa35908bd3344dc0604026:2,S +12 -0
  36. data/test/fixture/Maildir/kenseisecond/All Mail/new/1356207346_0.15143.thomanil-VirtualBox,U=1,FMD5=883ba13d52aa35908bd3344dc0604026:2, +70 -0
  37. data/test/fixture/Maildir/kenseisecond/INBOX/cur/1356207347_2.15143.thomanil-VirtualBox,U=3,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S +81 -0
  38. data/test/fixture/Maildir/kenseisecond/INBOX/new/1356207347_0.15143.thomanil-VirtualBox,U=1,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2, +70 -0
  39. data/test/fixture/Maildir/kenseisecond/Sent Mail/cur/1356207349_0.15143.thomanil-VirtualBox,U=1,FMD5=af48cce153be383d91f6c4a7c19fe087:2,S +12 -0
  40. data/test/fixture/Maildir/kenseisecond/help/cur/1356207351_0.15143.thomanil-VirtualBox,U=1,FMD5=657f8b8da628ef83cf69101b6817150a:2,S +81 -0
  41. data/test/fixture/Maildir/kenseisecond/nagging/cur/1356207351_1.15143.thomanil-VirtualBox,U=1,FMD5=be0b69d13a0baed63cc899dc05b36d80:2,S +79 -0
  42. data/test/test_helper.rb +14 -0
  43. data/test/test_kensei.rb +76 -0
  44. metadata +153 -0
@@ -0,0 +1,81 @@
1
+ MIME-Version: 1.0
2
+ Received: by 10.224.40.20; Wed, 19 Dec 2012 12:30:57 -0800 (PST)
3
+ Date: Wed, 19 Dec 2012 12:30:57 -0800
4
+ Message-ID: <CAOUbZP1Uj+9zOCcAyZgP1qoLy6HtrVijVP6GgjnJM9LGW0zUzg@mail.gmail.com>
5
+ Subject: Customize Gmail with colors and themes
6
+ From: Gmail Team <mail-noreply@google.com>
7
+ To: Kensei TestAccount <kensei.test.secondary@gmail.com>
8
+ Content-Type: multipart/alternative; boundary=047d7bf0e544e243e604d13a7d36
9
+
10
+ --047d7bf0e544e243e604d13a7d36
11
+ Content-Type: text/plain; charset=ISO-8859-1
12
+ Content-Transfer-Encoding: quoted-printable
13
+
14
+ To spice up your inbox with colors and themes, check out the Themes tab
15
+ under Settings.
16
+ Customize Gmail =BB <https://mail.google.com/mail/#settings/themes>
17
+
18
+ Enjoy!
19
+
20
+ - The Gmail Team
21
+ [image: Themes thumbnails]
22
+
23
+ Please note that Themes are not available if you're using Internet Explorer
24
+ 6.0. To take advantage of the latest Gmail features, please upgrade to a
25
+ fully supported
26
+ browser<http://support.google.com/mail/bin/answer.py?answer=3D6557&hl=3Den&=
27
+ utm_source=3Dwel-eml&utm_medium=3Deml&utm_campaign=3Den>
28
+ .
29
+
30
+ --047d7bf0e544e243e604d13a7d36
31
+ Content-Type: text/html; charset=ISO-8859-1
32
+
33
+ <html>
34
+ <font face="Arial, Helvetica, sans-serif">
35
+ <p>To spice up your inbox with colors and themes, check out the Themes tab
36
+ under Settings.</p>
37
+
38
+ <table cellpadding="0" cellspacing="0">
39
+ <col style="width: 1px;"/>
40
+ <col/>
41
+ <col style="width: 1px;"/>
42
+ <tr>
43
+ <td></td>
44
+ <td height="1px" style="background-color: #ddd"></td>
45
+ <td></td>
46
+ </tr>
47
+ <tr>
48
+ <td style="background-color: #ddd"></td>
49
+ <td background="https://mail.google.com/mail/images/welcome-button-background.png"
50
+ style="background-color: #ddd; background-repeat: repeat-x;
51
+ padding: 10px; font-size: larger">
52
+ <a href="https://mail.google.com/mail/#settings/themes"
53
+ style="font-weight: bold; color: #000; text-decoration: none;
54
+ display: block;">
55
+ Customize Gmail &#187;</a>
56
+ </td>
57
+ <td style="background-color: #ddd"></td>
58
+ </tr>
59
+ <tr>
60
+ <td></td>
61
+ <td height="1px" style="background-color: #ddd"></td>
62
+ <td></td>
63
+ </tr>
64
+ </table>
65
+
66
+ <p>Enjoy!</p>
67
+
68
+ <p>- The Gmail Team</p>
69
+
70
+ <img width="398" height="256" src="https://mail.google.com/mail/images/gmail_themes_2.png" alt="Themes thumbnails" />
71
+
72
+ <p><font size="-2" color="#999">Please note that Themes are not available if
73
+ you're using Internet Explorer 6.0. To take advantage of the latest Gmail
74
+ features, please
75
+ <a href="http://support.google.com/mail/bin/answer.py?answer=6557&hl=en&utm_source=wel-eml&utm_medium=eml&utm_campaign=en"><font color="#999">
76
+ upgrade to a fully supported browser</font></a>.</font></p>
77
+
78
+ </font>
79
+ </html>
80
+
81
+ --047d7bf0e544e243e604d13a7d36--
@@ -0,0 +1,70 @@
1
+ MIME-Version: 1.0
2
+ Received: by 10.224.40.20; Wed, 19 Dec 2012 12:30:56 -0800 (PST)
3
+ Date: Wed, 19 Dec 2012 12:30:56 -0800
4
+ Message-ID: <CAOUbZP2P5eaTabNq59Bnw5dZb7sbZpan+DA6DSm5j_VrZcdvsg@mail.gmail.com>
5
+ Subject: Get Gmail on your mobile phone
6
+ From: Gmail Team <mail-noreply@google.com>
7
+ To: Kensei TestAccount <kensei.test.secondary@gmail.com>
8
+ Content-Type: multipart/alternative; boundary=bcaec517c508d9166e04d13a7d52
9
+
10
+ --bcaec517c508d9166e04d13a7d52
11
+ Content-Type: text/plain; charset=ISO-8859-1
12
+ Content-Transfer-Encoding: quoted-printable
13
+
14
+ [image: Access Gmail on your mobile phone]
15
+ <http://www.google.com/intl/en/mobile/mail/#utm_source=3Dwel-eml&utm_medium=
16
+ =3Deml&utm_campaign=3Den>
17
+
18
+ The days of needing your computer to get to your inbox are long gone. You
19
+ can now use Gmail on your mobile phone to access your email from anywhere.
20
+ Get Gmail for your phone
21
+ =BB<http://www.google.com/intl/en/mobile/mail/#utm_source=3Dwel-eml&utm_med=
22
+ ium=3Deml&utm_campaign=3Den>
23
+
24
+ --bcaec517c508d9166e04d13a7d52
25
+ Content-Type: text/html; charset=ISO-8859-1
26
+
27
+ <html>
28
+ <font face="Arial, Helvetica, sans-serif">
29
+ <p>
30
+ <a href="http://www.google.com/intl/en/mobile/mail/#utm_source=wel-eml&utm_medium=eml&utm_campaign=en">
31
+ <img src="https://mail.google.com/mail/images/phones.png"
32
+ alt="Access Gmail on your mobile phone"
33
+ style="border:0px;"/>
34
+ </a>
35
+ </p>
36
+ <p>The days of needing your computer to get to your inbox are long gone. You can
37
+ now use Gmail on your mobile phone to access your email from anywhere.</p>
38
+
39
+ <table cellpadding="0" cellspacing="0">
40
+ <col style="width: 1px;"/>
41
+ <col/>
42
+ <col style="width: 1px;"/>
43
+ <tr>
44
+ <td></td>
45
+ <td height="1px" style="background-color: #ddd"></td>
46
+ <td></td>
47
+ </tr>
48
+ <tr>
49
+ <td style="background-color: #ddd"></td>
50
+ <td background="https://mail.google.com/mail/images/welcome-button-background.png"
51
+ style="background-color: #ddd; background-repeat: repeat-x;
52
+ padding: 10px; font-size: larger">
53
+ <a href="http://www.google.com/intl/en/mobile/mail/#utm_source=wel-eml&utm_medium=eml&utm_campaign=en"
54
+ style="font-weight: bold; color: #000; text-decoration: none;
55
+ display: block;">
56
+ Get Gmail for your phone &#187;</a>
57
+ </td>
58
+ <td style="background-color: #ddd"></td>
59
+ </tr>
60
+ <tr>
61
+ <td></td>
62
+ <td height="1px" style="background-color: #ddd"></td>
63
+ <td></td>
64
+ </tr>
65
+ </table>
66
+ </p>
67
+ </font>
68
+ </html>
69
+
70
+ --bcaec517c508d9166e04d13a7d52--
@@ -0,0 +1,12 @@
1
+ Return-Path: <kensei.test.secondary@gmail.com>
2
+ Received: from localhost (ti0018a380-dhcp3919.bb.online.no. [85.167.134.88])
3
+ by mx.google.com with ESMTPS id to7sm2217808lab.13.2012.12.22.12.12.59
4
+ (version=TLSv1/SSLv3 cipher=OTHER);
5
+ Sat, 22 Dec 2012 12:13:00 -0800 (PST)
6
+ Message-ID: <50d6144c.0794980a.1291.51fc@mx.google.com>
7
+ Date: Sat, 22 Dec 2012 12:13:00 -0800 (PST)
8
+ To: thomas@kjeldahlnilsson.net
9
+ From: kensei.test.secondary@gmail.com
10
+ Subject: A test
11
+
12
+ Yadda, yadda, yadda.
@@ -0,0 +1,81 @@
1
+ MIME-Version: 1.0
2
+ Received: by 10.224.40.20; Wed, 19 Dec 2012 12:30:57 -0800 (PST)
3
+ Date: Wed, 19 Dec 2012 12:30:57 -0800
4
+ Message-ID: <CAOUbZP1Uj+9zOCcAyZgP1qoLy6HtrVijVP6GgjnJM9LGW0zUzg@mail.gmail.com>
5
+ Subject: Customize Gmail with colors and themes
6
+ From: Gmail Team <mail-noreply@google.com>
7
+ To: Kensei TestAccount <kensei.test.secondary@gmail.com>
8
+ Content-Type: multipart/alternative; boundary=047d7bf0e544e243e604d13a7d36
9
+
10
+ --047d7bf0e544e243e604d13a7d36
11
+ Content-Type: text/plain; charset=ISO-8859-1
12
+ Content-Transfer-Encoding: quoted-printable
13
+
14
+ To spice up your inbox with colors and themes, check out the Themes tab
15
+ under Settings.
16
+ Customize Gmail =BB <https://mail.google.com/mail/#settings/themes>
17
+
18
+ Enjoy!
19
+
20
+ - The Gmail Team
21
+ [image: Themes thumbnails]
22
+
23
+ Please note that Themes are not available if you're using Internet Explorer
24
+ 6.0. To take advantage of the latest Gmail features, please upgrade to a
25
+ fully supported
26
+ browser<http://support.google.com/mail/bin/answer.py?answer=3D6557&hl=3Den&=
27
+ utm_source=3Dwel-eml&utm_medium=3Deml&utm_campaign=3Den>
28
+ .
29
+
30
+ --047d7bf0e544e243e604d13a7d36
31
+ Content-Type: text/html; charset=ISO-8859-1
32
+
33
+ <html>
34
+ <font face="Arial, Helvetica, sans-serif">
35
+ <p>To spice up your inbox with colors and themes, check out the Themes tab
36
+ under Settings.</p>
37
+
38
+ <table cellpadding="0" cellspacing="0">
39
+ <col style="width: 1px;"/>
40
+ <col/>
41
+ <col style="width: 1px;"/>
42
+ <tr>
43
+ <td></td>
44
+ <td height="1px" style="background-color: #ddd"></td>
45
+ <td></td>
46
+ </tr>
47
+ <tr>
48
+ <td style="background-color: #ddd"></td>
49
+ <td background="https://mail.google.com/mail/images/welcome-button-background.png"
50
+ style="background-color: #ddd; background-repeat: repeat-x;
51
+ padding: 10px; font-size: larger">
52
+ <a href="https://mail.google.com/mail/#settings/themes"
53
+ style="font-weight: bold; color: #000; text-decoration: none;
54
+ display: block;">
55
+ Customize Gmail &#187;</a>
56
+ </td>
57
+ <td style="background-color: #ddd"></td>
58
+ </tr>
59
+ <tr>
60
+ <td></td>
61
+ <td height="1px" style="background-color: #ddd"></td>
62
+ <td></td>
63
+ </tr>
64
+ </table>
65
+
66
+ <p>Enjoy!</p>
67
+
68
+ <p>- The Gmail Team</p>
69
+
70
+ <img width="398" height="256" src="https://mail.google.com/mail/images/gmail_themes_2.png" alt="Themes thumbnails" />
71
+
72
+ <p><font size="-2" color="#999">Please note that Themes are not available if
73
+ you're using Internet Explorer 6.0. To take advantage of the latest Gmail
74
+ features, please
75
+ <a href="http://support.google.com/mail/bin/answer.py?answer=6557&hl=en&utm_source=wel-eml&utm_medium=eml&utm_campaign=en"><font color="#999">
76
+ upgrade to a fully supported browser</font></a>.</font></p>
77
+
78
+ </font>
79
+ </html>
80
+
81
+ --047d7bf0e544e243e604d13a7d36--
@@ -0,0 +1,79 @@
1
+ MIME-Version: 1.0
2
+ Received: by 10.224.40.20; Wed, 19 Dec 2012 12:30:56 -0800 (PST)
3
+ Date: Wed, 19 Dec 2012 12:30:56 -0800
4
+ Message-ID: <CAOUbZP0JKBxunHUP3tUPNCXvzc9dgOiBBKcqeYKC_NyK=qhC=w@mail.gmail.com>
5
+ Subject: Import your contacts and old email
6
+ From: Gmail Team <mail-noreply@google.com>
7
+ To: Kensei TestAccount <kensei.test.secondary@gmail.com>
8
+ Content-Type: multipart/alternative; boundary=047d7bf15e3cddaf8004d13a7def
9
+
10
+ --047d7bf15e3cddaf8004d13a7def
11
+ Content-Type: text/plain; charset=ISO-8859-1
12
+ Content-Transfer-Encoding: quoted-printable
13
+
14
+ You can import your contacts and mail from Yahoo!, Hotmail, AOL, and many
15
+ other web mail or POP accounts. If you want, we'll even keep importing your
16
+ mail for the next 30 days.
17
+ Import contacts and mail
18
+ =BB<https://mail.google.com/mail/#settings/accounts>
19
+
20
+ We know it can be a pain to switch email accounts, and we hope this makes
21
+ the transition to Gmail a bit easier.
22
+
23
+ - The Gmail Team
24
+
25
+ Please note that importing is not available if you're using Internet
26
+ Explorer 6.0. To take advantage of the latest Gmail features, please upgrad=
27
+ e
28
+ to a fully supported
29
+ browser<http://support.google.com/mail/bin/answer.py?answer=3D6557&hl=3Den&=
30
+ utm_source=3Dwel-eml&utm_medium=3Deml&utm_campaign=3Den>
31
+ .
32
+
33
+ --047d7bf15e3cddaf8004d13a7def
34
+ Content-Type: text/html; charset=ISO-8859-1
35
+
36
+ <html>
37
+ <font face="Arial, Helvetica, sans-serif">
38
+ <p>You can import your contacts and mail from Yahoo!, Hotmail, AOL, and many
39
+ other web mail or POP accounts. If you want, we'll even keep importing your
40
+ mail for the next 30 days.</p>
41
+
42
+ <table cellpadding="0" cellspacing="0">
43
+ <col style="width: 1px" /><col /><col style="width: 1px" />
44
+ <tr>
45
+ <td></td>
46
+ <td height="1px" style="background-color: #ddd"></td>
47
+ <td></td>
48
+ </tr>
49
+ <tr>
50
+ <td style="background-color: #ddd"></td>
51
+ <td background="https://mail.google.com/mail/images/welcome-button-background.png"
52
+ style="background-color: #ddd; background-repeat: repeat-x"
53
+ ><a href="https://mail.google.com/mail/#settings/accounts"
54
+ style="font-weight: bold; color: #000; text-decoration: none; display: block; padding: 0.5em 1em"
55
+ >Import contacts and mail &#187;</a></td>
56
+ <td style="background-color: #ddd"></td>
57
+ </tr>
58
+ <tr>
59
+ <td></td>
60
+ <td height="1px" style="background-color: #ddd"></td>
61
+ <td></td>
62
+ </tr>
63
+ </table>
64
+
65
+ <p>We know it can be a pain to switch email accounts, and we hope this makes
66
+ the transition to Gmail a bit easier.</p>
67
+
68
+ <p>- The Gmail Team</p>
69
+
70
+ <p><font size="-2" color="#999">Please note that importing is not available if
71
+ you're using Internet Explorer 6.0. To take advantage of the latest Gmail
72
+ features, please
73
+ <a href="http://support.google.com/mail/bin/answer.py?answer=6557&hl=en&utm_source=wel-eml&utm_medium=eml&utm_campaign=en"><font color="#999">
74
+ upgrade to a fully supported browser</font></a>.</font></p>
75
+
76
+ </font>
77
+ </html>
78
+
79
+ --047d7bf15e3cddaf8004d13a7def--
@@ -0,0 +1,14 @@
1
+ require 'test/unit'
2
+ require 'shoulda'
3
+ require 'shoulda-context'
4
+
5
+ require File.dirname(__FILE__) + '/../lib/kensei'
6
+
7
+ def maildir_fixture_setup
8
+ `rm -rf ./test/fixture/current-tested-Maildir`
9
+ `cp -r ./test/fixture/Maildir test/fixture/current-tested-Maildir`
10
+ end
11
+
12
+ def maildir_fixture_path
13
+ File.expand_path("test/fixture/current-tested-Maildir")
14
+ end
@@ -0,0 +1,76 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+
3
+ class KenseiTest < Test::Unit::TestCase
4
+
5
+ context "Kensei API" do
6
+ setup do
7
+ @k = Kensei.new
8
+ @k.maildir_path = maildir_fixture_path
9
+ maildir_fixture_setup
10
+ end
11
+
12
+ should "be present" do
13
+ assert !Kensei.nil?
14
+ end
15
+
16
+ should "expose its version via its API" do
17
+ expected = Kensei::VERSION
18
+ actual = @k.version
19
+ assert_equal expected, actual
20
+ end
21
+
22
+ should "expose its version via the CLI binary, returned as json" do
23
+ expected = Kensei::VERSION.to_json
24
+ actual = `ruby -Ilib bin/kensei version`.chomp
25
+ assert_equal expected, actual
26
+ end
27
+
28
+ should "provide list of Maildir account ids/names" do
29
+ expected = ["kensei-first", "kenseisecond"]
30
+ actual = @k.account_ids
31
+ assert_equal expected, actual
32
+ end
33
+
34
+ should "provide unread email count for specific account" do
35
+ expected = 1
36
+ actual = @k.unread_count("kenseisecond")
37
+ assert_equal expected, actual
38
+ end
39
+
40
+ should "provide unified unread email countm, ie. all accounts" do
41
+ expected = 1
42
+ actual = @k.unified_unread_count
43
+ assert_equal expected, actual
44
+ end
45
+
46
+ should "provide folder list for specific account" do
47
+ expected = ["All Mail", "Drafts", "INBOX", "Important", "Sent Mail", "Spam", "Starred", "Trash", "help", "nagging"]
48
+ actual = @k.folder_list("kenseisecond")
49
+ assert_equal expected, actual
50
+ end
51
+
52
+ should "provide configured from-address for account id" do
53
+ expected = "kensei.test.secondary@gmail.com"
54
+ actual = @k.from_address("kenseisecond")
55
+ assert_equal expected, actual
56
+ end
57
+
58
+ should "construct new email body" do
59
+ expected = <<EMAIL
60
+ To: test@test.com
61
+ From: kensei.test.secondary@gmail.com
62
+ Subject: SUBJ
63
+ TEST
64
+ EMAIL
65
+ actual = @k.new_email_body("kenseisecond", "test@test.com", "SUBJ", "TEST")
66
+ assert_equal expected, actual
67
+ end
68
+
69
+ # NOTE not running this example/test since it actually sends the mail
70
+ #should "test mail send" do
71
+ # @k.send_email("kenseisecond", "thomas@kjeldahlnilsson.net", "Tested again", "WAT'\n\n WAT\nWAT")
72
+ #end
73
+
74
+ end
75
+
76
+ end
metadata ADDED
@@ -0,0 +1,153 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: Kensei
3
+ version: !ruby/object:Gem::Version
4
+ prerelease:
5
+ version: 0.0.2
6
+ platform: ruby
7
+ authors:
8
+ - Thomas Kjeldahl Nilsson
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+ date: 2012-12-23 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ type: :runtime
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ! '>='
27
+ - !ruby/object:Gem::Version
28
+ version: '0'
29
+ name: mail
30
+ - !ruby/object:Gem::Dependency
31
+ type: :development
32
+ requirement: !ruby/object:Gem::Requirement
33
+ none: false
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
42
+ - - ! '>='
43
+ - !ruby/object:Gem::Version
44
+ version: '0'
45
+ name: minitest
46
+ - !ruby/object:Gem::Dependency
47
+ type: :development
48
+ requirement: !ruby/object:Gem::Requirement
49
+ none: false
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ prerelease: false
55
+ version_requirements: !ruby/object:Gem::Requirement
56
+ none: false
57
+ requirements:
58
+ - - ! '>='
59
+ - !ruby/object:Gem::Version
60
+ version: '0'
61
+ name: shoulda
62
+ - !ruby/object:Gem::Dependency
63
+ type: :development
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
70
+ prerelease: false
71
+ version_requirements: !ruby/object:Gem::Requirement
72
+ none: false
73
+ requirements:
74
+ - - ! '>='
75
+ - !ruby/object:Gem::Version
76
+ version: '0'
77
+ name: shoulda-context
78
+ description: Rubygem backend for Kensei, the Emacs mail major mode
79
+ email:
80
+ - thomas@kjeldahlnilsson.net
81
+ executables:
82
+ - kensei
83
+ extensions: []
84
+ extra_rdoc_files: []
85
+ files:
86
+ - .gitignore
87
+ - Gemfile
88
+ - README.md
89
+ - Rakefile
90
+ - bin/kensei
91
+ - kensei.gemspec
92
+ - lib/kensei.rb
93
+ - test/fixture/Maildir/kensei-first/All Mail/cur/1356207330_0.15143.thomanil-VirtualBox,U=1,FMD5=883ba13d52aa35908bd3344dc0604026:2,S
94
+ - test/fixture/Maildir/kensei-first/All Mail/cur/1356207331_0.15143.thomanil-VirtualBox,U=2,FMD5=883ba13d52aa35908bd3344dc0604026:2,S
95
+ - test/fixture/Maildir/kensei-first/All Mail/cur/1356207332_0.15143.thomanil-VirtualBox,U=3,FMD5=883ba13d52aa35908bd3344dc0604026:2,S
96
+ - test/fixture/Maildir/kensei-first/All Mail/cur/1356207332_2.15143.thomanil-VirtualBox,U=4,FMD5=883ba13d52aa35908bd3344dc0604026:2,S
97
+ - test/fixture/Maildir/kensei-first/All Mail/cur/1356207333_1.15143.thomanil-VirtualBox,U=5,FMD5=883ba13d52aa35908bd3344dc0604026:2,S
98
+ - test/fixture/Maildir/kensei-first/All Mail/cur/1356207334_0.15143.thomanil-VirtualBox,U=6,FMD5=883ba13d52aa35908bd3344dc0604026:2,S
99
+ - test/fixture/Maildir/kensei-first/All Mail/cur/1356207334_1.15143.thomanil-VirtualBox,U=9,FMD5=883ba13d52aa35908bd3344dc0604026:2,S
100
+ - test/fixture/Maildir/kensei-first/All Mail/cur/1356207334_2.15143.thomanil-VirtualBox,U=10,FMD5=883ba13d52aa35908bd3344dc0604026:2,S
101
+ - test/fixture/Maildir/kensei-first/All Mail/cur/1356207335_0.15143.thomanil-VirtualBox,U=11,FMD5=883ba13d52aa35908bd3344dc0604026:2,S
102
+ - test/fixture/Maildir/kensei-first/All Mail/cur/1356207336_0.15143.thomanil-VirtualBox,U=12,FMD5=883ba13d52aa35908bd3344dc0604026:2,S
103
+ - test/fixture/Maildir/kensei-first/All Mail/cur/1356207336_1.15143.thomanil-VirtualBox,U=13,FMD5=883ba13d52aa35908bd3344dc0604026:2,S
104
+ - test/fixture/Maildir/kensei-first/INBOX/cur/1356207332_1.15143.thomanil-VirtualBox,U=1,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S
105
+ - test/fixture/Maildir/kensei-first/INBOX/cur/1356207333_0.15143.thomanil-VirtualBox,U=2,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S
106
+ - test/fixture/Maildir/kensei-first/INBOX/cur/1356207333_2.15143.thomanil-VirtualBox,U=5,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S
107
+ - test/fixture/Maildir/kensei-first/Sent Mail/cur/1356207337_0.15143.thomanil-VirtualBox,U=1,FMD5=af48cce153be383d91f6c4a7c19fe087:2,S
108
+ - test/fixture/Maildir/kensei-first/Sent Mail/cur/1356207337_1.15143.thomanil-VirtualBox,U=2,FMD5=af48cce153be383d91f6c4a7c19fe087:2,S
109
+ - test/fixture/Maildir/kensei-first/Sent Mail/cur/1356207338_0.15143.thomanil-VirtualBox,U=3,FMD5=af48cce153be383d91f6c4a7c19fe087:2,S
110
+ - test/fixture/Maildir/kensei-first/Sent Mail/cur/1356207338_1.15143.thomanil-VirtualBox,U=5,FMD5=af48cce153be383d91f6c4a7c19fe087:2,S
111
+ - test/fixture/Maildir/kensei-first/Sent Mail/cur/1356207339_0.15143.thomanil-VirtualBox,U=6,FMD5=af48cce153be383d91f6c4a7c19fe087:2,S
112
+ - test/fixture/Maildir/kensei-first/Sent Mail/cur/1356207339_1.15143.thomanil-VirtualBox,U=7,FMD5=af48cce153be383d91f6c4a7c19fe087:2,S
113
+ - test/fixture/Maildir/kensei-first/Sent Mail/cur/1356207340_0.15143.thomanil-VirtualBox,U=8,FMD5=af48cce153be383d91f6c4a7c19fe087:2,S
114
+ - test/fixture/Maildir/kensei-first/Trash/cur/1356207341_0.15143.thomanil-VirtualBox,U=1,FMD5=a7e253cd8dd95da3e20daf45519a8dc2:2,S
115
+ - test/fixture/Maildir/kensei-first/Trash/cur/1356207341_1.15143.thomanil-VirtualBox,U=2,FMD5=a7e253cd8dd95da3e20daf45519a8dc2:2,S
116
+ - test/fixture/Maildir/kensei-first/misc/cur/1356207342_0.15143.thomanil-VirtualBox,U=1,FMD5=bc957e26ff41470c556ee5d09e96880b:2,S
117
+ - test/fixture/Maildir/kensei-first/security/cur/1356207343_0.15143.thomanil-VirtualBox,U=1,FMD5=e91e6348157868de9dd8b25c81aebfb9:2,S
118
+ - test/fixture/Maildir/kenseisecond/All Mail/cur/1356207346_1.15143.thomanil-VirtualBox,U=2,FMD5=883ba13d52aa35908bd3344dc0604026:2,S
119
+ - test/fixture/Maildir/kenseisecond/All Mail/cur/1356207346_2.15143.thomanil-VirtualBox,U=3,FMD5=883ba13d52aa35908bd3344dc0604026:2,S
120
+ - test/fixture/Maildir/kenseisecond/All Mail/cur/1356207347_1.15143.thomanil-VirtualBox,U=4,FMD5=883ba13d52aa35908bd3344dc0604026:2,S
121
+ - test/fixture/Maildir/kenseisecond/All Mail/new/1356207346_0.15143.thomanil-VirtualBox,U=1,FMD5=883ba13d52aa35908bd3344dc0604026:2,
122
+ - test/fixture/Maildir/kenseisecond/INBOX/cur/1356207347_2.15143.thomanil-VirtualBox,U=3,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,S
123
+ - test/fixture/Maildir/kenseisecond/INBOX/new/1356207347_0.15143.thomanil-VirtualBox,U=1,FMD5=7e33429f656f1e6e9d79b29c3f82c57e:2,
124
+ - test/fixture/Maildir/kenseisecond/Sent Mail/cur/1356207349_0.15143.thomanil-VirtualBox,U=1,FMD5=af48cce153be383d91f6c4a7c19fe087:2,S
125
+ - test/fixture/Maildir/kenseisecond/help/cur/1356207351_0.15143.thomanil-VirtualBox,U=1,FMD5=657f8b8da628ef83cf69101b6817150a:2,S
126
+ - test/fixture/Maildir/kenseisecond/nagging/cur/1356207351_1.15143.thomanil-VirtualBox,U=1,FMD5=be0b69d13a0baed63cc899dc05b36d80:2,S
127
+ - test/test_helper.rb
128
+ - test/test_kensei.rb
129
+ homepage: https://kenseimail.org
130
+ licenses: []
131
+ post_install_message:
132
+ rdoc_options: []
133
+ require_paths:
134
+ - lib
135
+ required_ruby_version: !ruby/object:Gem::Requirement
136
+ none: false
137
+ requirements:
138
+ - - ! '>='
139
+ - !ruby/object:Gem::Version
140
+ version: '0'
141
+ required_rubygems_version: !ruby/object:Gem::Requirement
142
+ none: false
143
+ requirements:
144
+ - - ! '>='
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
147
+ requirements: []
148
+ rubyforge_project: kensei
149
+ rubygems_version: 1.8.24
150
+ signing_key:
151
+ specification_version: 3
152
+ summary: Rubygem backend for Kensei, the Emacs mail major mode
153
+ test_files: []