author | Mahlon E. Smith <mahlon@laika.com> |
Tue, 16 May 2017 15:52:05 -0700 | |
changeset 20 | 9d59d30685cb |
parent 17 | 23c7f5c8ee39 |
child 24 | f8873b391f3d |
permissions | -rw-r--r-- |
15 | 1 |
# vim: set nosta noet ts=4 sw=4 ft=rspec: |
1
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
2 |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
3 |
require_relative '../spec_helpers' |
1
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
4 |
|
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
5 |
describe Ezmlm::List do |
1d3cfd4837a8
Filled out the project, added Ezmlm module + spec.
Michael Granger <mgranger@laika.com>
parents:
diff
changeset
|
6 |
|
14 | 7 |
before( :each ) do |
8 |
@listdir = make_listdir() |
|
9 |
end |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
10 |
|
14 | 11 |
after( :each ) do |
12 |
rm_r( @listdir ) |
|
13 |
end |
|
14 |
||
15 |
let( :list ) do |
|
16 |
described_class.new( @listdir ) |
|
17 |
end |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
18 |
|
2
7b5a0131d5cd
Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents:
1
diff
changeset
|
19 |
|
15 | 20 |
it "returns the list name" do |
14 | 21 |
expect( list.name ).to eq( TEST_LIST_NAME ) |
22 |
end |
|
2
7b5a0131d5cd
Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents:
1
diff
changeset
|
23 |
|
15 | 24 |
it "returns the list host" do |
14 | 25 |
expect( list.host ).to eq( TEST_LIST_HOST ) |
26 |
end |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
27 |
|
15 | 28 |
it "returns the list address" do |
14 | 29 |
expect( list.address ).to eq( TEST_LIST_NAME + '@' + TEST_LIST_HOST ) |
30 |
end |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
31 |
|
14 | 32 |
it "returns nil if the list owner isn't an email address" do |
33 |
expect( list.owner ).to eq( nil ) |
|
34 |
end |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
35 |
|
15 | 36 |
it "returns an email address owner" do |
14 | 37 |
expect( list ).to receive( :read ).with( 'owner' ).and_return( TEST_OWNER ) |
38 |
expect( list.owner ).to eq( TEST_OWNER ) |
|
39 |
end |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
40 |
|
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
41 |
|
14 | 42 |
it "can add a new subscriber" do |
43 |
list.add_subscriber( *TEST_SUBSCRIBERS ) |
|
44 |
expect( list.is_subscriber?( TEST_SUBSCRIBERS.first ) ).to be_truthy |
|
45 |
end |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
46 |
|
15 | 47 |
it "returns the list of subscibers" do |
14 | 48 |
list.add_subscriber( *TEST_SUBSCRIBERS ) |
49 |
list.add_subscriber( 'notanemailaddress' ) |
|
50 |
expect( list.subscribers.length ).to eq( 3 ) |
|
51 |
expect( list.subscribers ).to include( TEST_SUBSCRIBERS.first ) |
|
52 |
end |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
53 |
|
14 | 54 |
it "can remove a current subscriber" do |
55 |
list.add_subscriber( *TEST_SUBSCRIBERS ) |
|
56 |
list.remove_subscriber( 'notanemailaddress' ) |
|
57 |
list.remove_subscriber( TEST_MODERATORS.first ) |
|
58 |
expect( list.subscribers.length ).to eq( 2 ) |
|
59 |
end |
|
5
804e1c2b9a40
* Added rdoc-generation to the cruise task and the artifacts that get saved
Michael Granger <mgranger@laika.com>
parents:
4
diff
changeset
|
60 |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
61 |
|
14 | 62 |
it "can add a new moderator" do |
63 |
list.add_moderator( *TEST_MODERATORS ) |
|
64 |
expect( list.is_moderator?( TEST_MODERATORS.first ) ).to be_truthy |
|
65 |
end |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
66 |
|
15 | 67 |
it "returns the list of moderators" do |
14 | 68 |
list.add_moderator( *TEST_MODERATORS ) |
69 |
expect( list.moderators.length ).to eq( 1 ) |
|
70 |
expect( list.moderators ).to include( TEST_MODERATORS.first ) |
|
71 |
end |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
72 |
|
14 | 73 |
it "can remove a current moderator" do |
74 |
list.add_moderator( *TEST_MODERATORS ) |
|
75 |
list.remove_moderator( TEST_MODERATORS.first ) |
|
76 |
expect( list.moderators ).to be_empty |
|
77 |
end |
|
2
7b5a0131d5cd
Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents:
1
diff
changeset
|
78 |
|
7b5a0131d5cd
Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents:
1
diff
changeset
|
79 |
|
14 | 80 |
it "can add a blacklisted address" do |
81 |
list.add_blacklisted( *TEST_MODERATORS ) |
|
82 |
expect( list.is_blacklisted?( TEST_MODERATORS.first ) ).to be_truthy |
|
83 |
end |
|
2
7b5a0131d5cd
Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents:
1
diff
changeset
|
84 |
|
15 | 85 |
it "returns the list of blacklisted addresses" do |
14 | 86 |
list.add_blacklisted( *TEST_MODERATORS ) |
87 |
expect( list.blacklisted.length ).to eq( 1 ) |
|
88 |
expect( list.blacklisted ).to include( TEST_MODERATORS.first ) |
|
89 |
end |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
90 |
|
14 | 91 |
it "can remove a blacklisted address" do |
92 |
list.add_blacklisted( *TEST_MODERATORS ) |
|
93 |
list.remove_blacklisted( TEST_MODERATORS.first ) |
|
94 |
expect( list.blacklisted ).to be_empty |
|
95 |
end |
|
2
7b5a0131d5cd
Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents:
1
diff
changeset
|
96 |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
97 |
|
14 | 98 |
it "can add an allowed address" do |
99 |
list.add_allowed( *TEST_MODERATORS ) |
|
100 |
expect( list.is_allowed?( TEST_MODERATORS.first ) ).to be_truthy |
|
101 |
end |
|
2
7b5a0131d5cd
Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents:
1
diff
changeset
|
102 |
|
15 | 103 |
it "returns the list of allowed addresses" do |
14 | 104 |
list.add_allowed( *TEST_MODERATORS ) |
105 |
expect( list.allowed.length ).to eq( 1 ) |
|
106 |
expect( list.allowed ).to include( TEST_MODERATORS.first ) |
|
107 |
end |
|
2
7b5a0131d5cd
Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents:
1
diff
changeset
|
108 |
|
14 | 109 |
it "can remove a allowed address" do |
110 |
list.add_allowed( *TEST_MODERATORS ) |
|
111 |
list.remove_allowed( TEST_MODERATORS.first ) |
|
112 |
expect( list.allowed ).to be_empty |
|
113 |
end |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
114 |
|
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
115 |
|
15 | 116 |
it 'returns the current public/private state' do |
14 | 117 |
expect( list.public? ).to be_truthy |
118 |
expect( list.private? ).to be_falsey |
|
119 |
end |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
120 |
|
14 | 121 |
it 'can set the privacy state' do |
122 |
list.public = false |
|
123 |
expect( list.public? ).to be_falsey |
|
124 |
expect( list.private? ).to be_truthy |
|
2
7b5a0131d5cd
Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents:
1
diff
changeset
|
125 |
|
14 | 126 |
list.private = false |
127 |
expect( list.private? ).to be_falsey |
|
128 |
expect( list.public? ).to be_truthy |
|
129 |
end |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
130 |
|
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
131 |
|
14 | 132 |
it 'can set the remote subscription state' do |
133 |
expect( list.remote_subscriptions? ).to be_falsey |
|
134 |
list.remote_subscriptions = true |
|
135 |
expect( list.remote_subscriptions? ).to be_truthy |
|
136 |
list.remote_subscriptions = false |
|
137 |
expect( list.remote_subscriptions? ).to be_falsey |
|
138 |
end |
|
2
7b5a0131d5cd
Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents:
1
diff
changeset
|
139 |
|
7b5a0131d5cd
Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents:
1
diff
changeset
|
140 |
|
14 | 141 |
it 'can set subscription moderation state' do |
142 |
expect( list.moderated_subscriptions? ).to be_falsey |
|
143 |
list.moderated_subscriptions = true |
|
144 |
expect( list.moderated_subscriptions? ).to be_truthy |
|
145 |
list.moderated_subscriptions = false |
|
146 |
expect( list.moderated_subscriptions? ).to be_falsey |
|
147 |
end |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
148 |
|
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
149 |
|
14 | 150 |
it 'can set posting moderation state' do |
151 |
expect( list.moderated? ).to be_falsey |
|
152 |
list.moderated = true |
|
153 |
expect( list.moderated? ).to be_truthy |
|
154 |
list.moderated = false |
|
155 |
expect( list.moderated? ).to be_falsey |
|
2
7b5a0131d5cd
Added more list-config accessors
Michael Granger <mgranger@laika.com>
parents:
1
diff
changeset
|
156 |
end |
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
157 |
|
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
158 |
|
14 | 159 |
it 'can set moderation-only posting' do |
160 |
expect( list.moderator_posts_only? ).to be_falsey |
|
161 |
list.moderator_posts_only = true |
|
162 |
expect( list.moderator_posts_only? ).to be_truthy |
|
163 |
list.moderator_posts_only = false |
|
164 |
expect( list.moderator_posts_only? ).to be_falsey |
|
165 |
end |
|
166 |
||
167 |
||
168 |
it 'can set user-only posting' do |
|
169 |
expect( list.user_posts_only? ).to be_falsey |
|
170 |
list.user_posts_only = true |
|
171 |
expect( list.user_posts_only? ).to be_truthy |
|
172 |
list.user_posts_only = false |
|
173 |
expect( list.user_posts_only? ).to be_falsey |
|
174 |
end |
|
175 |
||
176 |
||
177 |
it 'user+moderation together sets non-subscriber moderation' do |
|
178 |
expect( list.user_posts_only? ).to be_falsey |
|
179 |
expect( list.moderated? ).to be_falsey |
|
180 |
||
181 |
list.moderated = true |
|
182 |
list.user_posts_only = true |
|
183 |
||
184 |
expect( list.listdir + 'noreturnposts' ).to exist |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
185 |
|
14 | 186 |
list.moderated = false |
187 |
expect( list.listdir + 'noreturnposts' ).to_not exist |
|
188 |
end |
|
189 |
||
190 |
||
191 |
it 'can set archival status' do |
|
192 |
expect( list.archived? ).to be_truthy |
|
17 | 193 |
list.archived = false |
14 | 194 |
expect( list.archived? ).to be_falsey |
17 | 195 |
list.archived = true |
14 | 196 |
expect( list.archived? ).to be_truthy |
197 |
end |
|
198 |
||
199 |
||
200 |
it 'can limit archive access to moderators only' do |
|
201 |
expect( list.private_archive? ).to be_falsey |
|
202 |
list.private_archive = true |
|
203 |
expect( list.private_archive? ).to be_truthy |
|
204 |
list.private_archive = false |
|
205 |
expect( list.private_archive? ).to be_falsey |
|
206 |
end |
|
207 |
||
208 |
||
209 |
it 'can limit archive access to list subscribers only' do |
|
210 |
expect( list.guarded_archive? ).to be_falsey |
|
211 |
list.guarded_archive = true |
|
212 |
expect( list.guarded_archive? ).to be_truthy |
|
213 |
list.guarded_archive = false |
|
214 |
expect( list.guarded_archive? ).to be_falsey |
|
215 |
end |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
216 |
|
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
217 |
|
14 | 218 |
it 'can toggle digest status' do |
219 |
expect( list.digested? ).to be_falsey |
|
220 |
list.digest = true |
|
221 |
expect( list.digested? ).to be_truthy |
|
222 |
list.digest = false |
|
223 |
expect( list.digested? ).to be_falsey |
|
224 |
end |
|
225 |
||
226 |
it 'returns a default digest kbyte size' do |
|
227 |
expect( list.digest_kbytesize ).to eq( 64 ) |
|
228 |
end |
|
229 |
||
230 |
it 'can set a new digest kbyte size' do |
|
231 |
list.digest_kbytesize = 300 |
|
232 |
expect( list.digest_kbytesize ).to eq( 300 ) |
|
233 |
end |
|
234 |
||
235 |
it 'returns a default digest message count' do |
|
236 |
expect( list.digest_count ).to eq( 10 ) |
|
237 |
end |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
238 |
|
14 | 239 |
it 'can set a new digest message count' do |
240 |
list.digest_count = 25 |
|
241 |
expect( list.digest_count ).to eq( 25 ) |
|
242 |
end |
|
243 |
||
244 |
it 'returns a default digest timeout' do |
|
245 |
expect( list.digest_timeout ).to eq( 48 ) |
|
246 |
end |
|
247 |
||
248 |
it 'can set a new digest timeout' do |
|
249 |
list.digest_timeout = 24 |
|
250 |
expect( list.digest_timeout ).to eq( 24 ) |
|
251 |
end |
|
252 |
||
253 |
||
254 |
it 'can set subscription confirmation' do |
|
255 |
expect( list.confirm_subscriptions? ).to be_truthy |
|
256 |
list.confirm_subscriptions = false |
|
257 |
expect( list.confirm_subscriptions? ).to be_falsey |
|
258 |
list.confirm_subscriptions = true |
|
259 |
expect( list.confirm_subscriptions? ).to be_truthy |
|
260 |
end |
|
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
261 |
|
14 | 262 |
it 'can set unsubscription confirmation' do |
263 |
expect( list.confirm_unsubscriptions? ).to be_truthy |
|
264 |
list.confirm_unsubscriptions = false |
|
265 |
expect( list.confirm_unsubscriptions? ).to be_falsey |
|
266 |
list.confirm_unsubscriptions = true |
|
267 |
expect( list.confirm_unsubscriptions? ).to be_truthy |
|
268 |
end |
|
269 |
||
270 |
||
271 |
it 'can set message posting confirmation' do |
|
272 |
expect( list.confirm_postings? ).to be_falsey |
|
273 |
list.confirm_postings = true |
|
274 |
expect( list.confirm_postings? ).to be_truthy |
|
275 |
list.confirm_postings = false |
|
276 |
expect( list.confirm_postings? ).to be_falsey |
|
277 |
end |
|
278 |
||
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
279 |
|
14 | 280 |
it 'can toggle remote subscriber lists for moderators' do |
281 |
expect( list.allow_remote_listing? ).to be_falsey |
|
282 |
list.allow_remote_listing = true |
|
283 |
expect( list.allow_remote_listing? ).to be_truthy |
|
284 |
list.allow_remote_listing = false |
|
285 |
expect( list.allow_remote_listing? ).to be_falsey |
|
286 |
end |
|
287 |
||
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
288 |
|
14 | 289 |
it 'can toggle bounce management' do |
290 |
expect( list.bounce_warnings? ).to be_truthy |
|
291 |
list.bounce_warnings = false |
|
292 |
expect( list.bounce_warnings? ).to be_falsey |
|
293 |
list.bounce_warnings = true |
|
294 |
expect( list.bounce_warnings? ).to be_truthy |
|
295 |
end |
|
296 |
||
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
297 |
|
14 | 298 |
it 'returns a default max message size' do |
299 |
expect( list.maximum_message_size ).to eq( 0 ) |
|
300 |
end |
|
301 |
||
302 |
it 'can set a new max message size' do |
|
303 |
list.maximum_message_size = 1024 * 300 |
|
304 |
expect( list.maximum_message_size ).to eq( 307200 ) |
|
305 |
end |
|
306 |
||
307 |
||
15 | 308 |
it 'can return the total message count for a pristine list' do |
309 |
expect( list ).to receive( :read ).with( 'archnum' ).and_return( nil ) |
|
14 | 310 |
expect( list.message_count ).to eq( 0 ) |
311 |
end |
|
15 | 312 |
|
313 |
it 'can return the total message count for a list with deliveries' do |
|
314 |
expect( list.message_count ).to eq( 150 ) |
|
315 |
end |
|
316 |
||
317 |
||
318 |
it 'can generate a message number to thread index' do |
|
319 |
idx = list.index |
|
320 |
expect( idx.size ).to be( 150 ) |
|
321 |
expect( idx[39][:thread] ).to eq( 'cadgeokhhaieijmndokb' ) |
|
322 |
end |
|
323 |
||
324 |
||
325 |
it 'fetches thread objects upon request' do |
|
326 |
expect( list.thread('cadgeokhhaieijmndokb') ).to be_a( Ezmlm::List::Thread ) |
|
327 |
end |
|
328 |
||
17 | 329 |
it 'returns nil when fetching an invalid thread' do |
330 |
expect( list.thread('whatever') ).to be_nil |
|
331 |
end |
|
332 |
||
15 | 333 |
|
334 |
it 'fetches author objects upon request' do |
|
335 |
expect( list.author('ojjhjlapnejjlbcplabi') ).to be_a( Ezmlm::List::Author ) |
|
336 |
end |
|
337 |
||
16
e135ccae6783
Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents:
15
diff
changeset
|
338 |
it 'fetches author objects by email address' do |
e135ccae6783
Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents:
15
diff
changeset
|
339 |
author = list.author( 'ojjhjlapnejjlbcplabi' ) |
e135ccae6783
Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents:
15
diff
changeset
|
340 |
expect( list.author('yvette@example.net').name ).to eq( author.name ) |
e135ccae6783
Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents:
15
diff
changeset
|
341 |
end |
e135ccae6783
Migrate hashing functions to C.
Mahlon E. Smith <mahlon@laika.com>
parents:
15
diff
changeset
|
342 |
|
17 | 343 |
it 'returns nil when fetching an invalid author' do |
344 |
expect( list.author('whatever') ).to be_nil |
|
345 |
end |
|
346 |
||
15 | 347 |
|
348 |
context 'fetching messages' do |
|
17 | 349 |
it 'returns nil if archiving is disabled' do |
15 | 350 |
expect( list ).to receive( :archived? ).and_return( false ) |
17 | 351 |
expect( list.message(1) ).to be_nil |
352 |
end |
|
353 |
||
354 |
it 'returns nil when fetching an invalid message id' do |
|
355 |
expect( list.message(2389234) ).to be_nil |
|
15 | 356 |
end |
357 |
||
358 |
it 'raises an error if the message archive is empty' do |
|
359 |
expect( list ).to receive( :message_count ).and_return( 0 ) |
|
360 |
expect { |
|
361 |
list.message( 1 ) |
|
362 |
}.to raise_error( RuntimeError, /message archive is empty/i ) |
|
363 |
end |
|
364 |
||
365 |
it 'returns an archived message' do |
|
366 |
message = list.message( 1 ) |
|
367 |
expect( message.id ).to be( 1 ) |
|
368 |
expect( message.subject ).to match( /compress program/ ) |
|
369 |
end |
|
370 |
||
371 |
it 'can iterate across all messages' do |
|
372 |
message = nil |
|
373 |
list.each_message do |m| |
|
374 |
if m.id == 20 |
|
375 |
message = m |
|
376 |
break |
|
377 |
end |
|
378 |
end |
|
379 |
expect( message ).to_not be_nil |
|
380 |
expect( message.id ).to be( 20 ) |
|
381 |
end |
|
382 |
end |
|
14 | 383 |
end |
12
3cc813140c80
First round of modernizing after a long absence.
Mahlon E. Smith <mahlon@martini.nu>
parents:
6
diff
changeset
|
384 |