summaryrefslogtreecommitdiff
path: root/test/rss/test_accessor.rb
blob: dd75b69c457223230fbbf1c04aa104d7988f42c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# -*- tab-width: 2 -*- vim: ts=2

require "test/unit"
require "rss/parser"
require "rss/1.0"
require "rss/2.0"
dir = File.dirname(File.expand_path(__FILE__))
$:.push(dir)
require "common"
$:.delete(dir)

class TestAccessor < Test::Unit::TestCase
	include TestRSSMixin
	
	def test_date
		channel = Rss::Channel.new
		channel.do_validate = false
		channel.pubDate = nil
		assert_nil(channel.pubDate)

		time = Time.now
		channel.pubDate = time
		assert_equal(time, channel.pubDate)

		channel.pubDate = nil
		assert_nil(channel.pubDate)
	end

end