diff options
author | Jari Vetoniemi <jari.vetoniemi@indooratlas.com> | 2020-03-16 18:49:26 +0900 |
---|---|---|
committer | Jari Vetoniemi <jari.vetoniemi@indooratlas.com> | 2020-03-30 00:39:06 +0900 |
commit | fcbf63e62c627deae76c1b8cb8c0876c536ed811 (patch) | |
tree | 64cb17de3f41a2b6fef2368028fbd00349946994 /jni/ruby/test/rss/test_inherit.rb |
Fresh start
Diffstat (limited to 'jni/ruby/test/rss/test_inherit.rb')
-rw-r--r-- | jni/ruby/test/rss/test_inherit.rb | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/jni/ruby/test/rss/test_inherit.rb b/jni/ruby/test/rss/test_inherit.rb new file mode 100644 index 0000000..8b640dc --- /dev/null +++ b/jni/ruby/test/rss/test_inherit.rb @@ -0,0 +1,40 @@ +require_relative "rss-testcase" + +require "rss/1.0" + +module RSS + class TestInherit < TestCase + + class InheritedImage < RSS::RDF::Image + def self.indent_size; 1; end + def self.tag_name; 'image'; end + end + + def setup + @rss = make_RDF(<<-EOR) +#{make_channel} +#{make_image} +#{make_item} +#{make_textinput} +EOR + end + + def test_inherit + rss = RSS::Parser.parse(@rss) + orig_image = rss.image + prefix = "[INHERIT]" + image = InheritedImage.new("#{prefix} #{orig_image.about}") + image.title = "#{prefix} #{orig_image.title}" + image.url = "#{prefix} #{orig_image.url}" + image.link = "#{prefix} #{orig_image.link}" + rss.image = image + + new_rss = RSS::Parser.parse(rss.to_s) + new_image = new_rss.image + assert_equal("#{prefix} #{orig_image.about}", new_image.about) + assert_equal("#{prefix} #{orig_image.title}", new_image.title) + assert_equal("#{prefix} #{orig_image.url}", new_image.url) + assert_equal("#{prefix} #{orig_image.link}", new_image.link) + end + end +end |