pony 0.6 → 0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +10 -0
- data/lib/pony.rb +1 -1
- data/pony.gemspec +1 -1
- data/spec/pony_spec.rb +16 -6
- metadata +3 -3
data/README.rdoc
CHANGED
@@ -71,6 +71,13 @@ Other options
|
|
71
71
|
smtp # specify smtp info, see Transport section above
|
72
72
|
tls # use tls, see TLS/SSL section above
|
73
73
|
|
74
|
+
== External Dependencies
|
75
|
+
|
76
|
+
tmail ~> 1.0
|
77
|
+
mime-types >= 1.16
|
78
|
+
|
79
|
+
Note: these requirements are specified in the gemspec as well. Also, you may need smtp_tls if you want to send via tls and are using ruby < 1.8.7
|
80
|
+
|
74
81
|
== Meta
|
75
82
|
|
76
83
|
Maintained by Ben Prew
|
@@ -88,6 +95,9 @@ mailing list: ponyrb@googlegroups.com
|
|
88
95
|
|
89
96
|
== Releases
|
90
97
|
|
98
|
+
0.7
|
99
|
+
* Pass :cc and :bcc options to sendmail appropriately
|
100
|
+
|
91
101
|
0.6
|
92
102
|
* Add :bcc capability
|
93
103
|
* Add :charset capability
|
data/lib/pony.rb
CHANGED
data/pony.gemspec
CHANGED
data/spec/pony_spec.rb
CHANGED
@@ -121,36 +121,46 @@ Y29udGVudCBvZiBmb28ucGRm
|
|
121
121
|
Net::SMTP.stub!(:new).and_return(@smtp)
|
122
122
|
end
|
123
123
|
|
124
|
+
it "passes cc and bcc as the list of recipients" do
|
125
|
+
@smtp.should_receive(:send_message).with("message", 'from', ['to', 'cc', 'bcc'])
|
126
|
+
Pony.transport_via_smtp(mock('tmail', :to => 'to', :cc => 'cc', :from => 'from', :to_s => 'message', :bcc => 'bcc'))
|
127
|
+
end
|
128
|
+
|
129
|
+
it "only pass cc as the list of recipients" do
|
130
|
+
@smtp.should_receive(:send_message).with("message", 'from', ['to', 'cc' ])
|
131
|
+
Pony.transport_via_smtp(mock('tmail', :to => 'to', :cc => 'cc', :from => 'from', :to_s => 'message', :bcc => ''))
|
132
|
+
end
|
133
|
+
|
124
134
|
it "defaults to localhost as the SMTP server" do
|
125
135
|
Net::SMTP.should_receive(:new).with('localhost', '25').and_return(@smtp)
|
126
|
-
Pony.transport_via_smtp(mock('tmail', :to => 'to', :from => 'from', :to_s => 'message'))
|
136
|
+
Pony.transport_via_smtp(mock('tmail', :to => 'to', :from => 'from', :to_s => 'message', :cc => '', :bcc => ''))
|
127
137
|
end
|
128
138
|
|
129
139
|
it "uses SMTP authorization when auth key is provided" do
|
130
140
|
o = { :smtp => { :user => 'user', :password => 'password', :auth => 'plain'}}
|
131
141
|
@smtp.should_receive(:start).with('localhost.localdomain', 'user', 'password', 'plain')
|
132
|
-
Pony.transport_via_smtp(mock('tmail', :to => 'to', :from => 'from', :to_s => 'message'), o)
|
142
|
+
Pony.transport_via_smtp(mock('tmail', :to => 'to', :from => 'from', :to_s => 'message', :cc => '', :bcc => ''), o)
|
133
143
|
end
|
134
144
|
|
135
145
|
it "enable starttls when tls option is true" do
|
136
146
|
o = { :smtp => { :user => 'user', :password => 'password', :auth => 'plain', :tls => true}}
|
137
147
|
@smtp.should_receive(:enable_starttls)
|
138
|
-
Pony.transport_via_smtp(mock('tmail', :to => 'to', :from => 'from', :to_s => 'message'), o)
|
148
|
+
Pony.transport_via_smtp(mock('tmail', :to => 'to', :from => 'from', :to_s => 'message', :cc => '', :bcc => ''), o)
|
139
149
|
end
|
140
150
|
|
141
151
|
it "starts the job" do
|
142
152
|
@smtp.should_receive(:start)
|
143
|
-
Pony.transport_via_smtp(mock('tmail', :to => 'to', :from => 'from', :to_s => 'message'))
|
153
|
+
Pony.transport_via_smtp(mock('tmail', :to => 'to', :from => 'from', :to_s => 'message', :cc => '', :bcc => ''))
|
144
154
|
end
|
145
155
|
|
146
156
|
it "sends a tmail message" do
|
147
157
|
@smtp.should_receive(:send_message)
|
148
|
-
Pony.transport_via_smtp(mock('tmail', :to => 'to', :from => 'from', :to_s => 'message'))
|
158
|
+
Pony.transport_via_smtp(mock('tmail', :to => 'to', :from => 'from', :to_s => 'message', :cc => '', :bcc => ''))
|
149
159
|
end
|
150
160
|
|
151
161
|
it "finishes the job" do
|
152
162
|
@smtp.should_receive(:finish)
|
153
|
-
Pony.transport_via_smtp(mock('tmail', :to => 'to', :from => 'from', :to_s => 'message'))
|
163
|
+
Pony.transport_via_smtp(mock('tmail', :to => 'to', :from => 'from', :to_s => 'message', :cc => '', :bcc => ''))
|
154
164
|
end
|
155
165
|
|
156
166
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pony
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: "0.
|
4
|
+
version: "0.7"
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Wiggins
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2010-
|
13
|
+
date: 2010-03-09 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -46,8 +46,8 @@ files:
|
|
46
46
|
- Rakefile
|
47
47
|
- pony.gemspec
|
48
48
|
- lib/pony.rb
|
49
|
-
- spec/base.rb
|
50
49
|
- spec/pony_spec.rb
|
50
|
+
- spec/base.rb
|
51
51
|
has_rdoc: true
|
52
52
|
homepage: http://github.com/benprew/pony
|
53
53
|
licenses: []
|