diff options
author | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-25 06:35:04 +0000 |
---|---|---|
committer | kou <kou@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2019-01-25 06:35:04 +0000 |
commit | cee0c36a0890dd44efacf4ea0d37872fb3e903c6 (patch) | |
tree | 932c2a99d9e585af73b00edb3fdc6ed8ea057026 /test | |
parent | 6375c68f8851e1e0fee8a95afba91c4555097127 (diff) | |
download | bundler-cee0c36a0890dd44efacf4ea0d37872fb3e903c6.tar.gz |
Upgrade RSS to 0.2.8
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/rss/rss-assertions.rb | 63 | ||||
-rw-r--r-- | test/rss/test_itunes.rb | 6 | ||||
-rw-r--r-- | test/rss/test_maker_itunes.rb | 9 | ||||
-rw-r--r-- | test/rss/test_version.rb | 10 |
4 files changed, 59 insertions, 29 deletions
diff --git a/test/rss/rss-assertions.rb b/test/rss/rss-assertions.rb index 1bafb02f86..86fb91aa18 100644 --- a/test/rss/rss-assertions.rb +++ b/test/rss/rss-assertions.rb @@ -1113,8 +1113,11 @@ EOA :xml_content => target.xhtml, } end - _assert_maker_atom_element(feed_type, maker_readers, feed_readers, - maker_extractor, feed_extractor, + _assert_maker_atom_element(feed_type, + maker_readers, true, + feed_readers, + maker_extractor, + feed_extractor, &block) end @@ -1215,8 +1218,11 @@ EOA :content => target.content, } end - _assert_maker_atom_element(feed_type, maker_readers, feed_readers, - maker_extractor, feed_extractor, + _assert_maker_atom_element(feed_type, + maker_readers, false, + feed_readers, + maker_extractor, + feed_extractor, &block) end @@ -1248,13 +1254,21 @@ EOA end end - def _assert_maker_atom_element(feed_type, maker_readers, feed_readers, - maker_extractor, feed_extractor) + def _assert_maker_atom_element(feed_type, + maker_readers, + maker_readers_need_block, + feed_readers, + maker_extractor, + feed_extractor) _wrap_assertion do element = nil feed = RSS::Maker.make("atom:#{feed_type}") do |maker| yield maker - target = chain_reader(maker, maker_readers) {|x| x} + if maker_readers_need_block + target = chain_reader(maker, maker_readers) {|x| x} + else + target = chain_reader(maker, maker_readers) + end element = maker_extractor.call(target) end @@ -1462,8 +1476,11 @@ EOA :content => target.content, } end - _assert_maker_atom_element(feed_type, maker_readers, feed_readers, - maker_extractor, feed_extractor, + _assert_maker_atom_element(feed_type, + maker_readers, true, + feed_readers, + maker_extractor, + feed_extractor, &block) end @@ -1505,8 +1522,11 @@ EOA :content => target.content, } end - _assert_maker_atom_element(feed_type, maker_readers, feed_readers, - maker_extractor, feed_extractor, + _assert_maker_atom_element(feed_type, + maker_readers, true, + feed_readers, + maker_extractor, + feed_extractor, &block) end @@ -1623,8 +1643,11 @@ EOA :uri => target.content, } end - _assert_maker_atom_element(feed_type, maker_readers, feed_readers, - maker_extractor, feed_extractor, + _assert_maker_atom_element(feed_type, + maker_readers, true, + feed_readers, + maker_extractor, + feed_extractor, &block) end @@ -1664,8 +1687,11 @@ EOA nil end end - _assert_maker_atom_element(feed_type, maker_readers, feed_readers, - maker_extractor, feed_extractor, + _assert_maker_atom_element(feed_type, + maker_readers, true, + feed_readers, + maker_extractor, + feed_extractor, &block) end @@ -1727,8 +1753,11 @@ EOA :out_of_line => target.out_of_line?, } end - _assert_maker_atom_element(feed_type, maker_readers, feed_readers, - maker_extractor, feed_extractor, + _assert_maker_atom_element(feed_type, + maker_readers, true, + feed_readers, + maker_extractor, + feed_extractor, &block) end diff --git a/test/rss/test_itunes.rb b/test/rss/test_itunes.rb index 456e0afb20..4459d8bfc7 100644 --- a/test/rss/test_itunes.rb +++ b/test/rss/test_itunes.rb @@ -203,14 +203,18 @@ module RSS _assert_itunes_duration(7, 14, 5, "7:14:05", readers, &rss20_maker) _assert_itunes_duration(0, 4, 55, "04:55", readers, &rss20_maker) _assert_itunes_duration(0, 4, 5, "4:05", readers, &rss20_maker) + _assert_itunes_duration(0, 0, 5, "5", readers, &rss20_maker) + _assert_itunes_duration(0, 3, 15, "195", readers, &rss20_maker) + _assert_itunes_duration(1, 0, 1, "3601", readers, &rss20_maker) - _assert_itunes_duration_not_available_value("5", &rss20_maker) _assert_itunes_duration_not_available_value("09:07:14:05", &rss20_maker) _assert_itunes_duration_not_available_value("10:5", &rss20_maker) _assert_itunes_duration_not_available_value("10:03:5", &rss20_maker) _assert_itunes_duration_not_available_value("10:3:05", &rss20_maker) _assert_itunes_duration_not_available_value("xx:xx:xx", &rss20_maker) + + _assert_itunes_duration_not_available_value("", &rss20_maker) end end diff --git a/test/rss/test_maker_itunes.rb b/test/rss/test_maker_itunes.rb index 5b435f5aec..cba612c099 100644 --- a/test/rss/test_maker_itunes.rb +++ b/test/rss/test_maker_itunes.rb @@ -250,14 +250,21 @@ module RSS feed_readers) _assert_maker_itunes_duration(0, 4, 5, "4:05", maker_readers, feed_readers) + _assert_maker_itunes_duration(0, 0, 5, "0:05", maker_readers, + feed_readers) + _assert_maker_itunes_duration_by_value(0, 5, 15, "315", maker_readers, + feed_readers) + _assert_maker_itunes_duration_by_value(1, 0, 1, "3601", maker_readers, + feed_readers) - _assert_maker_itunes_duration_invalid_value("5", maker_readers) _assert_maker_itunes_duration_invalid_value("09:07:14:05", maker_readers) _assert_maker_itunes_duration_invalid_value("10:5", maker_readers) _assert_maker_itunes_duration_invalid_value("10:03:5", maker_readers) _assert_maker_itunes_duration_invalid_value("10:3:05", maker_readers) _assert_maker_itunes_duration_invalid_value("xx:xx:xx", maker_readers) + + _assert_maker_itunes_duration_invalid_value("", maker_readers) end end diff --git a/test/rss/test_version.rb b/test/rss/test_version.rb deleted file mode 100644 index 731e7e5e20..0000000000 --- a/test/rss/test_version.rb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: false -require_relative "rss-testcase" - -module RSS - class TestVersion < TestCase - def test_version - assert_equal("0.2.7", ::RSS::VERSION) - end - end -end |