diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/rexml/test_elements.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/rexml/test_elements.rb b/test/rexml/test_elements.rb index 210004a1c0..7d2839e261 100644 --- a/test/rexml/test_elements.rb +++ b/test/rexml/test_elements.rb @@ -84,6 +84,15 @@ class ElementsTester < Test::Unit::TestCase assert_equal 7, count end + def test_each_with_frozen_condition + doc = Document.new('<books><book name="Ruby"/><book name="XML"/></books>') + names = [] + doc.root.elements.each('book'.freeze) do |element| + names << element.attributes["name"] + end + assert_equal(["Ruby", "XML"], names) + end + def test_elements_to_a doc = Document.new '<a>sean<b/>elliott<c/></a>' assert_equal 2, doc.root.elements.to_a.size |