diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-22 23:26:05 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-12-22 23:26:05 +0000 |
commit | 3971bc3c70f12a21907069d4426a3391b1e05c53 (patch) | |
tree | 9e386f7b51ee4ed71f17e347fbdea98b8bb0f534 /test/net/smtp/test_response.rb | |
parent | d236a0ca3bf63e2c5164310a4c849beabb64f3c8 (diff) | |
download | ruby-3971bc3c70f12a21907069d4426a3391b1e05c53.tar.gz |
adding more tests for Net::SMTP::Response class
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/net/smtp/test_response.rb')
-rw-r--r-- | test/net/smtp/test_response.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/net/smtp/test_response.rb b/test/net/smtp/test_response.rb index 696a72157f..d810bf0b93 100644 --- a/test/net/smtp/test_response.rb +++ b/test/net/smtp/test_response.rb @@ -32,6 +32,32 @@ module Net res = Response.parse("badstring") assert_equal({}, res.capabilities) end + + def test_success? + res = Response.parse("250-ubuntu-desktop\n250-SIZE 1 2 3\n250 DSN\n") + assert res.success? + assert !res.continue? + end + + # RFC 2821, Section 4.2.1 + def test_continue? + res = Response.parse("3yz-ubuntu-desktop\n250-SIZE 1 2 3\n250 DSN\n") + assert !res.success? + assert res.continue? + end + + def test_status_type_char + res = Response.parse("3yz-ubuntu-desktop\n250-SIZE 1 2 3\n250 DSN\n") + assert_equal '3', res.status_type_char + + res = Response.parse("250-ubuntu-desktop\n250-SIZE 1 2 3\n250 DSN\n") + assert_equal '2', res.status_type_char + end + + def test_message + res = Response.parse("250-ubuntu-desktop\n250-SIZE 1 2 3\n250 DSN\n") + assert_equal "250-ubuntu-desktop\n", res.message + end end end end |