diff options
| author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-01 13:30:08 +0000 |
|---|---|---|
| committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-11-01 13:30:08 +0000 |
| commit | 4058e0bbefcc0c82b725b7dba0ac00de405b8d01 (patch) | |
| tree | 14b80106549cee7003c56ccecac4027a24ad17d8 /test | |
| parent | 02acbbe1a2404a4be5ee998a907d32b2493b9e43 (diff) | |
| download | ruby-4058e0bbefcc0c82b725b7dba0ac00de405b8d01.tar.gz ruby-4058e0bbefcc0c82b725b7dba0ac00de405b8d01.tar.xz ruby-4058e0bbefcc0c82b725b7dba0ac00de405b8d01.zip | |
* lib/rss/maker/base.rb: changed xml-stylesheet's API of RSS Maker
to like item's one.
* lib/rss/xml-stylesheet.rb (RSS::XMLStyleSheet#guess_type): fixed
regular expression bug.
* test/rss/test_maker_xml-stylesheet.rb: updated tests for xml-stylesheet.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@7173 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
| -rw-r--r-- | test/rss/test_maker_xml-stylesheet.rb | 29 |
1 files changed, 21 insertions, 8 deletions
diff --git a/test/rss/test_maker_xml-stylesheet.rb b/test/rss/test_maker_xml-stylesheet.rb index 13ab0daf8..b95907355 100644 --- a/test/rss/test_maker_xml-stylesheet.rb +++ b/test/rss/test_maker_xml-stylesheet.rb @@ -14,14 +14,13 @@ module RSS alternate = 'yes' rss = RSS::Maker.make("1.0") do |maker| - maker.xml_stylesheets << { - :href => href, - :type => type, - :title => title, - :media => media, - :charset => charset, - :alternate => alternate, - } + xss = maker.xml_stylesheets.new_xml_stylesheet + xss.href = href + xss.type = type + xss.title = title + xss.media = media + xss.charset = charset + xss.alternate = alternate setup_dummy_channel(maker) end @@ -33,6 +32,20 @@ module RSS assert_equal(media, xss.media) assert_equal(charset, xss.charset) assert_equal(alternate, xss.alternate) + + + href = 'http://example.com/index.xsl' + type = 'text/xsl' + rss = RSS::Maker.make("1.0") do |maker| + xss = maker.xml_stylesheets.new_xml_stylesheet + xss.href = href + + setup_dummy_channel(maker) + end + + xss = rss.xml_stylesheets.first + assert_equal(href, xss.href) + assert_equal(type, xss.type) end end |
