Sha256: e9e6a8d03788101874b48d4548b25d2baba8fea052908bac656d0b0d0aa84f29
Contents?: true
Size: 1.8 KB
Versions: 8
Compression:
Stored size: 1.8 KB
Contents
require 'test/unit' require 'net/nntp.rb' class TestNNTPArticle < Test::Unit::TestCase def setup @article = Net::NNTP::Article.new @article.overview_format = "215 Order of fields in overview database.\r\nSubject:\r\nFrom:\r\nDate:\r\nMessage-ID:\r\nReferences:\r\nBytes:\r\nLines:\r\nXref:full\r\n.\r\n" end def test_article_new a = Net::NNTP::Article.new end def test_article_id @article.id = 1 assert_equal 1, @article.id end def test_article_messageid m = '<bla.foo@some.host>' @article.messageid = m assert_equal m, @article.messageid end def test_article_subject s = 'bla' @article.subject = s assert_equal s, @article.subject end def test_from_xover over = "1\tTesting\t\"abc\" abc@ide.invalid\t17 Aug 2004 14:00:00 GMT\t<this.post@is.invalid>\t\t200\t2\tXref: this.host.invalid alt.test:1" @article.overview(over) assert_equal '1', @article.id assert_equal '<this.post@is.invalid>', @article.messageid assert_equal 'Testing', @article.subject assert_equal 200, @article.bytes.to_i assert_equal 2, @article.lines.to_i assert_equal '17 Aug 2004 14:00:00 GMT', @article.date end def test_overview_fmt= @article.overview_format = "215 Order of fields in overview database.\r\nSubject:\r\nFrom:\r\nDate:\r\nMessage-ID:\r\nReferences:\r\nBytes:\r\nLines:\r\nXref:full\r\n.\r\n" assert_equal 'subject', @article.overview_format[1] assert_equal 'from', @article.overview_format[2] assert_equal 'date', @article.overview_format[3] assert_equal 'messageid', @article.overview_format[4] assert_equal 'references', @article.overview_format[5] assert_equal 'bytes', @article.overview_format[6] assert_equal 'lines', @article.overview_format[7] assert_equal 'xref', @article.overview_format[8] end end
Version data entries
8 entries across 8 versions & 1 rubygems