summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-29 08:38:11 +0000
committerkou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-29 08:38:11 +0000
commit7556f66e9cd2eaca3c7cc114f56be732c8845086 (patch)
treec2966c4a6f99a28efb5799752bab1d63a4254bb9
parentf6c7804c16e019bda446bebc17f32049880277cd (diff)
* lib/rss/maker/base.rb (RSS::Maker::RSSBase#make): require block.
* test/rss/test_maker_{0.9,1.0,2.0}.rb: follow the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--lib/rss/maker/base.rb8
-rw-r--r--test/rss/test_maker_0.9.rb5
-rw-r--r--test/rss/test_maker_1.0.rb7
-rw-r--r--test/rss/test_maker_2.0.rb5
5 files changed, 17 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 7ef1963..405ef3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Sun Jun 29 17:37:23 2008 Kouhei Sutou <kou@cozmixng.org>
+
+ * lib/rss/maker/base.rb (RSS::Maker::RSSBase#make): require block.
+ * test/rss/test_maker_{0.9,1.0,2.0}.rb: follow the above change.
+
Sun Jun 29 17:33:34 2008 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/maker/base.rb, lib/rss/maker/itunes.rb: don't use
diff --git a/lib/rss/maker/base.rb b/lib/rss/maker/base.rb
index 907451c..0713d27 100644
--- a/lib/rss/maker/base.rb
+++ b/lib/rss/maker/base.rb
@@ -411,12 +411,8 @@ module RSS
end
def make
- if block_given?
- yield(self)
- to_feed
- else
- nil
- end
+ yield(self)
+ to_feed
end
def to_feed
diff --git a/test/rss/test_maker_0.9.rb b/test/rss/test_maker_0.9.rb
index c211bf6..815f9e3 100644
--- a/test/rss/test_maker_0.9.rb
+++ b/test/rss/test_maker_0.9.rb
@@ -6,8 +6,9 @@ module RSS
class TestMaker09 < TestCase
def test_rss
- rss = RSS::Maker.make("0.91")
- assert_nil(rss)
+ assert_raise(LocalJumpError) do
+ RSS::Maker.make("0.91")
+ end
rss = RSS::Maker.make("0.9") do |maker|
setup_dummy_channel(maker)
diff --git a/test/rss/test_maker_1.0.rb b/test/rss/test_maker_1.0.rb
index 60cc370..49d506b 100644
--- a/test/rss/test_maker_1.0.rb
+++ b/test/rss/test_maker_1.0.rb
@@ -6,6 +6,10 @@ module RSS
class TestMaker10 < TestCase
def test_rdf
+ assert_raise(LocalJumpError) do
+ RSS::Maker.make("1.0")
+ end
+
rss = RSS::Maker.make("1.0") do |maker|
setup_dummy_channel(maker)
setup_dummy_item(maker)
@@ -48,9 +52,6 @@ module RSS
link = "http://hoge.com"
description = "fugafugafugafuga"
- rss = RSS::Maker.make("1.0")
- assert_nil(rss)
-
rss = RSS::Maker.make("1.0") do |maker|
maker.channel.about = about
maker.channel.title = title
diff --git a/test/rss/test_maker_2.0.rb b/test/rss/test_maker_2.0.rb
index c338e34..f6d4a11 100644
--- a/test/rss/test_maker_2.0.rb
+++ b/test/rss/test_maker_2.0.rb
@@ -6,8 +6,9 @@ module RSS
class TestMaker20 < TestCase
def test_rss
- rss = RSS::Maker.make("2.0")
- assert_nil(rss)
+ assert_raise(LocalJumpError) do
+ RSS::Maker.make("2.0")
+ end
rss = RSS::Maker.make("2.0") do |maker|
setup_dummy_channel(maker)