diff options
Diffstat (limited to 'test/rss/test_atom.rb')
-rw-r--r-- | test/rss/test_atom.rb | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/test/rss/test_atom.rb b/test/rss/test_atom.rb index 80da69bd94..e0ae108698 100644 --- a/test/rss/test_atom.rb +++ b/test/rss/test_atom.rb @@ -453,11 +453,13 @@ module RSS def assert_atom_link_to_s(target_class) _wrap_assertion do href = "http://example.com/atom.xml" - rel = "self" - type = "application/atom+xml" - hreflang = "ja" - title = "Atom Feed" - length = "801" + optvs = { + 'rel' => "self", + 'type' => "application/atom+xml", + 'hreflang' => "ja", + 'title' => "Atom Feed", + 'length' => "801", + } link = target_class.new assert_equal("", link.to_s) @@ -472,24 +474,24 @@ module RSS rest = optional_arguments.reject {|x| x == name} link = target_class.new - link.__send__("#{name}=", eval(name)) + link.__send__("#{name}=", optvs[name]) assert_equal("", link.to_s) rest.each do |n| - link.__send__("#{n}=", eval(n)) + link.__send__("#{n}=", optvs[n]) assert_equal("", link.to_s) end link = target_class.new link.href = href - link.__send__("#{name}=", eval(name)) - attrs = [["href", href], [name, eval(name)]] + link.__send__("#{name}=", optvs[name]) + attrs = [["href", href], [name, optvs[name]]] xml = REXML::Document.new(link.to_s).root assert_rexml_element([], attrs, nil, xml) rest.each do |n| - link.__send__("#{n}=", eval(n)) - attrs << [n, eval(n)] + link.__send__("#{n}=", optvs[n]) + attrs << [n, optvs[n]] xml = REXML::Document.new(link.to_s).root assert_rexml_element([], attrs, nil, xml) end |