summaryrefslogtreecommitdiff
path: root/test/rss
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-16 09:22:55 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-05-16 09:22:55 +0000
commita687b15ff8df120be282d939bc1ff21b1a4861fd (patch)
treedbe0db9ee9de40c41d247a05c275e50fb74a8f1d /test/rss
parentc5f0360c074ca35d26ab73740bdb7c6eca98b94d (diff)
* lib/rss/maker.rb, lib/rss/maker/0.9.rb,
test/test_maker_*.rb: add RSS::Maker.supported? git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/rss')
-rw-r--r--test/rss/test_maker_0.9.rb11
-rw-r--r--test/rss/test_maker_1.0.rb7
-rw-r--r--test/rss/test_maker_2.0.rb7
-rw-r--r--test/rss/test_maker_atom_entry.rb6
-rw-r--r--test/rss/test_maker_atom_feed.rb9
5 files changed, 40 insertions, 0 deletions
diff --git a/test/rss/test_maker_0.9.rb b/test/rss/test_maker_0.9.rb
index 61b272d..32aa183 100644
--- a/test/rss/test_maker_0.9.rb
+++ b/test/rss/test_maker_0.9.rb
@@ -4,6 +4,17 @@ require "rss/maker"
module RSS
class TestMaker09 < TestCase
+ def test_supported?
+ assert(RSS::Maker.supported?("0.9"))
+ assert(RSS::Maker.supported?("rss0.9"))
+ assert(RSS::Maker.supported?("0.91"))
+ assert(RSS::Maker.supported?("rss0.91"))
+ assert(RSS::Maker.supported?("0.92"))
+ assert(RSS::Maker.supported?("rss0.92"))
+ assert(!RSS::Maker.supported?("0.93"))
+ assert(!RSS::Maker.supported?("rss0.93"))
+ end
+
def test_find_class
assert_equal(RSS::Maker::RSS091, RSS::Maker["0.91"])
assert_equal(RSS::Maker::RSS091, RSS::Maker["rss0.91"])
diff --git a/test/rss/test_maker_1.0.rb b/test/rss/test_maker_1.0.rb
index 47bfe99..b465556 100644
--- a/test/rss/test_maker_1.0.rb
+++ b/test/rss/test_maker_1.0.rb
@@ -4,6 +4,13 @@ require "rss/maker"
module RSS
class TestMaker10 < TestCase
+ def test_supported?
+ assert(RSS::Maker.supported?("1.0"))
+ assert(RSS::Maker.supported?("rss1.0"))
+ assert(!RSS::Maker.supported?("1.1"))
+ assert(!RSS::Maker.supported?("rss1.1"))
+ end
+
def test_find_class
assert_equal(RSS::Maker::RSS10, RSS::Maker["1.0"])
assert_equal(RSS::Maker::RSS10, RSS::Maker["rss1.0"])
diff --git a/test/rss/test_maker_2.0.rb b/test/rss/test_maker_2.0.rb
index 7285f11..6321ea5 100644
--- a/test/rss/test_maker_2.0.rb
+++ b/test/rss/test_maker_2.0.rb
@@ -4,6 +4,13 @@ require "rss/maker"
module RSS
class TestMaker20 < TestCase
+ def test_supported?
+ assert(RSS::Maker.supported?("2.0"))
+ assert(RSS::Maker.supported?("rss2.0"))
+ assert(!RSS::Maker.supported?("2.2"))
+ assert(!RSS::Maker.supported?("rss2.2"))
+ end
+
def test_find_class
assert_equal(RSS::Maker::RSS20, RSS::Maker["2.0"])
assert_equal(RSS::Maker::RSS20, RSS::Maker["rss2.0"])
diff --git a/test/rss/test_maker_atom_entry.rb b/test/rss/test_maker_atom_entry.rb
index 94e4255..4275bdc 100644
--- a/test/rss/test_maker_atom_entry.rb
+++ b/test/rss/test_maker_atom_entry.rb
@@ -4,6 +4,12 @@ require "rss/maker"
module RSS
class TestMakerAtomEntry < TestCase
+ def test_supported?
+ assert(RSS::Maker.supported?("atom:entry"))
+ assert(RSS::Maker.supported?("atom1.0:entry"))
+ assert(!RSS::Maker.supported?("atom2.0:entry"))
+ end
+
def test_find_class
assert_equal(RSS::Maker::Atom::Entry, RSS::Maker["atom:entry"])
assert_equal(RSS::Maker::Atom::Entry, RSS::Maker["atom1.0:entry"])
diff --git a/test/rss/test_maker_atom_feed.rb b/test/rss/test_maker_atom_feed.rb
index 2ca67e7..724763b 100644
--- a/test/rss/test_maker_atom_feed.rb
+++ b/test/rss/test_maker_atom_feed.rb
@@ -4,6 +4,15 @@ require "rss/maker"
module RSS
class TestMakerAtomFeed < TestCase
+ def test_supported?
+ assert(RSS::Maker.supported?("atom"))
+ assert(RSS::Maker.supported?("atom:feed"))
+ assert(RSS::Maker.supported?("atom1.0"))
+ assert(RSS::Maker.supported?("atom1.0:feed"))
+ assert(!RSS::Maker.supported?("atom2.0"))
+ assert(!RSS::Maker.supported?("atom2.0:feed"))
+ end
+
def test_find_class
assert_equal(RSS::Maker::Atom::Feed, RSS::Maker["atom"])
assert_equal(RSS::Maker::Atom::Feed, RSS::Maker["atom:feed"])