From 3a55515ee8f3ca410adba6eea0b043dd6dccd242 Mon Sep 17 00:00:00 2001 From: kou Date: Sun, 18 Jun 2006 09:03:36 +0000 Subject: * lib/rss/rss.rb: fixed typo: except -> expect * lib/rss/parser.rb: ditto. * test/rss/rss-assertions.rb: ditto. * test/rss/test_parser.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 7 +++++++ lib/rss/parser.rb | 4 ++-- lib/rss/rss.rb | 6 ++++-- test/rss/rss-assertions.rb | 6 +++--- test/rss/test_parser.rb | 2 +- 5 files changed, 17 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e3c20cf50..76f205662b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Sun Jun 18 18:01:26 2006 Kouhei Sutou + + * lib/rss/rss.rb: fixed typo: except -> expect + * lib/rss/parser.rb: ditto. + * test/rss/rss-assertions.rb: ditto. + * test/rss/test_parser.rb: ditto. + Sun Jun 18 17:52:39 2006 Kouhei Sutou * lib/rss/rss.rb: RSS::Element#calc_indent became to be deprecated. diff --git a/lib/rss/parser.rb b/lib/rss/parser.rb index 10c6be8534..f7308db591 100644 --- a/lib/rss/parser.rb +++ b/lib/rss/parser.rb @@ -345,7 +345,7 @@ module RSS if current_class.tag_name parent = current_class.tag_name end - raise NotExceptedTagError.new(local, parent) + raise NotExpectedTagError.new(local, parent) end end end @@ -374,7 +374,7 @@ module RSS @last_element.__send__(setter, text.to_s) else if @do_validate and not @ignore_unknown_element - raise NotExceptedTagError.new(tag_name, @last_element.tag_name) + raise NotExpectedTagError.new(tag_name, @last_element.tag_name) end end } diff --git a/lib/rss/rss.rb b/lib/rss/rss.rb index 3ef5db1866..d24a387fe1 100644 --- a/lib/rss/rss.rb +++ b/lib/rss/rss.rb @@ -86,13 +86,15 @@ module RSS end end - class NotExceptedTagError < InvalidRSSError + class NotExpectedTagError < InvalidRSSError attr_reader :tag, :parent def initialize(tag, parent) @tag, @parent = tag, parent super("tag <#{tag}> is not expected in tag <#{parent}>") end end + # For backward compatibility :X + NotExceptedTagError = NotExpectedTagError class NotAvailableValueError < InvalidRSSError attr_reader :tag, :value, :attribute @@ -868,7 +870,7 @@ EOC end if !tags.nil? and !tags.empty? - raise NotExceptedTagError.new(tag, tag_name) + raise NotExpectedTagError.new(tag, tag_name) end end diff --git a/test/rss/rss-assertions.rb b/test/rss/rss-assertions.rb index f90eb7f3f2..fc2cd3cbed 100644 --- a/test/rss/rss-assertions.rb +++ b/test/rss/rss-assertions.rb @@ -71,12 +71,12 @@ module RSS end end - def assert_not_excepted_tag(tag, parent) + def assert_not_expected_tag(tag, parent) _wrap_assertion do begin yield - flunk("Not raise NotExceptedTagError") - rescue ::RSS::NotExceptedTagError => e + flunk("Not raise NotExpectedTagError") + rescue ::RSS::NotExpectedTagError => e assert_equal(tag, e.tag) assert_equal(parent, e.parent) end diff --git a/test/rss/test_parser.rb b/test/rss/test_parser.rb index f410b1b4f0..47bbc2d9d9 100644 --- a/test/rss/test_parser.rb +++ b/test/rss/test_parser.rb @@ -612,7 +612,7 @@ EOR assert_parse(rss, :nothing_raised) - assert_not_excepted_tag("a", "RDF") do + assert_not_expected_tag("a", "RDF") do Parser.parse(rss, true, false) end -- cgit v1.2.3