bouncestudio 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,99 @@
1
+ require File.dirname(__FILE__) + '/test_helper.rb'
2
+
3
+ class BouncestudioTest < Test::Unit::TestCase
4
+
5
+ def setup
6
+ license_code = BS_LICENSE
7
+ @studio = BoogieTools::BounceStudio.new license_code
8
+ @raw = IO.read File.join(File.dirname(__FILE__), "raw_message.txt")
9
+ end
10
+
11
+ def test_truth
12
+ assert true
13
+ end
14
+
15
+ def test_studio_type
16
+ assert_equal Object, BoogieTools::BounceStudio.superclass
17
+ assert_equal BoogieTools::BounceStudio, @studio.class
18
+ end
19
+
20
+ def test_check
21
+ bounce_code = @studio.check(@raw)
22
+ assert bounce_code.is_a?(Fixnum)
23
+ assert_equal bounce_code, 10
24
+ end
25
+
26
+ def test_body
27
+ body = @studio.body(@raw)
28
+ assert body.is_a?(String)
29
+ end
30
+
31
+ def test_from_address
32
+ from_address = @studio.from_address(@raw)
33
+ assert from_address.is_a?(String)
34
+ assert !from_address.empty?
35
+ assert_equal from_address, "MAILER-DAEMON@mail.coinet.com".downcase
36
+ end
37
+
38
+ def test_from_friendly_name
39
+ from_friendly_name = @studio.from_friendly_name(@raw)
40
+ assert from_friendly_name.is_a?(String)
41
+ assert from_friendly_name.empty?
42
+ end
43
+
44
+ def test_header
45
+ header = @studio.header(@raw)
46
+ assert header.is_a?(String)
47
+ assert !header.empty?
48
+ end
49
+
50
+ def test_reply_to_address
51
+ reply_to_address = @studio.reply_to_address(@raw)
52
+ assert reply_to_address.is_a?(String)
53
+ assert reply_to_address.empty?
54
+ end
55
+
56
+ def test_reply_to_friendly_name
57
+ reply_to_friendly_name = @studio.reply_to_friendly_name(@raw)
58
+ assert reply_to_friendly_name.is_a?(String)
59
+ assert reply_to_friendly_name.empty?
60
+ end
61
+
62
+ def test_subject
63
+ subject = @studio.subject(@raw)
64
+ assert subject.is_a?(String)
65
+ assert !subject.empty?
66
+ assert_equal subject.chomp, "failure notice"
67
+ end
68
+
69
+ def test_to_address
70
+ to_address = @studio.to_address(@raw)
71
+ assert to_address.is_a?(String)
72
+ assert !to_address.empty?
73
+ assert_equal to_address, "joebob@joe.net"
74
+ end
75
+
76
+ def test_to_friendly_name
77
+ to_friendly_name = @studio.to_friendly_name(@raw)
78
+ assert to_friendly_name.is_a?(String)
79
+ assert to_friendly_name.empty?
80
+ end
81
+
82
+ def test_custom_header
83
+ custom_header = @studio.custom_header(@raw, "X-OriginalArrivalTime".downcase)
84
+ assert custom_header.is_a?(String)
85
+ assert custom_header.empty?
86
+
87
+ date_header = @studio.custom_header(@raw, "Date".downcase)
88
+ assert date_header.is_a?(String)
89
+ assert !date_header.empty?
90
+ assert_equal date_header.chomp, "21 Aug 2000 21:08:21 -0000"
91
+ end
92
+
93
+ def test_orig_custom_header
94
+ orig_custom_header = @studio.orig_custom_header(@raw, "X-OriginalArrivalTime".downcase)
95
+ assert orig_custom_header.is_a?(String)
96
+ assert !orig_custom_header.empty?
97
+ assert_equal orig_custom_header.chomp, "21 Aug 2000 21:08:20.0944 (UTC) FILETIME=[EF5F8500:01C00BB3]"
98
+ end
99
+ end
@@ -0,0 +1,50 @@
1
+
2
+ Return-Path: <>
3
+ Received: from defiant.coinet.com ([204.245.234.17])
4
+ by detmail.somedomain.net (Post.Office MTA v3.5.3 release 223
5
+ ID# 0-65382U1000L100S0V35) with SMTP id net
6
+ for <joebob@joe.net>; Mon, 21 Aug 2000 14:07:48 -0700
7
+ Received: (qmail 849 invoked for bounce); 21 Aug 2000 21:08:21 -0000
8
+ Date: 21 Aug 2000 21:08:21 -0000
9
+ From: MAILER-DAEMON@mail.coinet.com
10
+ To: joebob@joe.net
11
+ Subject: failure notice
12
+
13
+ Hi. This is the mail transport agent at mail.coinet.com.
14
+ I'm afraid I wasn't able to deliver your message to the following addresses.
15
+ This is a permanent error; I've given up. If you have questions about this
16
+ notice, please forward it to postmaster@coinet.com along with your comments.
17
+
18
+ <wolfden@coinet.com>:
19
+ Sorry, this account has been deactivated. (#5.2.1)
20
+
21
+ --- Below this line is a copy of the message.
22
+
23
+ Return-Path: <joebob@joe.net>
24
+ Received: (qmail 841 invoked from network); 21 Aug 2000 21:08:21 -0000
25
+ Received: from pool104.somedomain.com (HELO detcmail02.somedomain.net) (1.2.3.4)
26
+ by coinet.com with SMTP; 21 Aug 2000 21:08:21 -0000
27
+ Received: from detcmail02 ([2.3.4.5]) by detcmail02.somedomain.net with Microsoft SMTPSVC(5.0.2172.1);
28
+ Mon, 21 Aug 2000 14:08:20 -0700
29
+ From: "JOE.NET" <joebob@joe.net>
30
+ Reply-To: "JOE.NET" <some_reply@joe.net>
31
+ To: <wolfden@coinet.com>
32
+ Date: Mon, 21 Aug 00 14:08:20 -0700
33
+ Subject: JOE.NET NEWS!
34
+ MIME-Version: 1.0
35
+ Content-Type: multipart/alternative; boundary="----_=_Send_NextPart_180_03281976"
36
+ Return-Path: joebob@joe.net
37
+ Message-ID: <DETCMAIL02agW2wx6Di000110f7@DETcmail02.somedomain.net>
38
+ X-OriginalArrivalTime: 21 Aug 2000 21:08:20.0944 (UTC) FILETIME=[EF5F8500:01C00BB3]
39
+
40
+ This is a multi-part message in MIME format.
41
+
42
+
43
+ ------_=_Send_NextPart_180_03281976
44
+ Content-Type: text/plain; charset=us-ascii
45
+
46
+ Here's my test message. This is the body of the message.... Cool.... Okay, bye!
47
+
48
+ .
49
+
50
+
@@ -0,0 +1,9 @@
1
+ require 'test/unit'
2
+ require File.dirname(__FILE__) + '/../lib/bouncestudio'
3
+ if ENV['BS_LICENSE']
4
+ BS_LICENSE = ENV['BS_LICENSE']
5
+ else
6
+ puts "Set the environment variable BS_LICENSE with your BoogieTools license code to avoid tarpit"
7
+ BS_LICENSE = "nolicense"
8
+ end
9
+
metadata ADDED
@@ -0,0 +1,58 @@
1
+ --- !ruby/object:Gem::Specification
2
+ rubygems_version: 0.8.11
3
+ specification_version: 1
4
+ name: bouncestudio
5
+ version: !ruby/object:Gem::Version
6
+ version: 0.0.2
7
+ date: 2007-02-27 00:00:00 -05:00
8
+ summary: A Ruby API wrapping the BounceStudio library from Boogie Tools
9
+ require_paths:
10
+ - lib
11
+ - ext
12
+ email: joshua@zaadz.com
13
+ homepage: http://bouncestudio.rubyforge.org
14
+ rubyforge_project: bouncestudio
15
+ description: A Ruby API wrapping the BounceStudio library from Boogie Tools
16
+ autorequire:
17
+ default_executable:
18
+ bindir: bin
19
+ has_rdoc: true
20
+ required_ruby_version: !ruby/object:Gem::Version::Requirement
21
+ requirements:
22
+ - - ">"
23
+ - !ruby/object:Gem::Version
24
+ version: 0.0.0
25
+ version:
26
+ platform: ruby
27
+ signing_key:
28
+ cert_chain:
29
+ authors:
30
+ - Joshua Warchol
31
+ files:
32
+ - Rakefile
33
+ - README.txt
34
+ - CHANGELOG.txt
35
+ - Manifest.txt
36
+ - setup.rb
37
+ - lib/bouncestudio/version.rb
38
+ - lib/bouncestudio.rb
39
+ - test/test_helper.rb
40
+ - test/bouncestudio_test.rb
41
+ - test/raw_message.txt
42
+ - ext/bounce_studio.c
43
+ - ext/extconf.rb
44
+ - ext/Makefile
45
+ test_files:
46
+ - test/bouncestudio_test.rb
47
+ rdoc_options: []
48
+
49
+ extra_rdoc_files: []
50
+
51
+ executables: []
52
+
53
+ extensions:
54
+ - ext/extconf.rb
55
+ requirements: []
56
+
57
+ dependencies: []
58
+