smtp.tests: send-mail should be called to get the mock-smtp-server to terminate

db4
Björn Lindqvist 2014-09-24 00:46:47 +02:00 committed by John Benediktsson
parent 8b01a47358
commit d952ac0c07
1 changed files with 13 additions and 9 deletions

View File

@ -1,5 +1,5 @@
USING: smtp tools.test io.streams.string io.sockets USING: combinators continuations smtp tools.test io.streams.string
io.sockets.secure threads smtp.server kernel sequences io.sockets io.sockets.secure threads smtp.server kernel sequences
namespaces logging accessors assocs sorting smtp.private namespaces logging accessors assocs sorting smtp.private
concurrency.promises system ; concurrency.promises system ;
IN: smtp.tests IN: smtp.tests
@ -76,13 +76,17 @@ IN: smtp.tests
"Ed <dharmatech@factorcode.org>" "Ed <dharmatech@factorcode.org>"
} >>to } >>to
"Doug <erg@factorcode.org>" >>from "Doug <erg@factorcode.org>" >>from
[ {
email>headers sort-keys [ [
drop { "Date" "Message-Id" } member? not email>headers sort-keys [
] assoc-filter drop { "Date" "Message-Id" } member? not
] ] assoc-filter
[ to>> [ extract-email ] map ] ]
[ from>> extract-email ] tri [ to>> [ extract-email ] map ]
[ from>> extract-email ]
! To get the smtp server to clean up itself
[ [ send-email ] ignore-errors drop ]
} cleave
] with-test-smtp-config ] with-test-smtp-config
] unit-test ] unit-test