You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

smtp_spec.rb 715B

1234567891011121314151617181920212223242526272829
  1. describe CryptCheck::Tls::Smtp do
  2. def server(*args, **kargs, &block)
  3. kargs[:plain_process] = proc do |socket|
  4. socket.write "220 localhost\r\n"
  5. socket.gets
  6. socket.write "250-STARTTLS\r\n"
  7. socket.gets
  8. socket.write "220 Ready to start TLS\r\n"
  9. true
  10. end unless kargs.include? :plain_process
  11. starttls_serv *args, **kargs, &block
  12. end
  13. def plain_server(*args, **kargs, &block)
  14. kargs[:plain_process] = proc do |socket|
  15. socket.write "220 localhost\r\n"
  16. socket.gets
  17. socket.write "250 DONE\r\n"
  18. false
  19. end unless kargs.include? :plain_process
  20. starttls_serv *args, **kargs, &block
  21. end
  22. def analyze(*args)
  23. CryptCheck::Tls::Smtp.analyze *args
  24. end
  25. include_examples :analysis
  26. end