summaryrefslogtreecommitdiff
path: root/test/rexml
diff options
context:
space:
mode:
Diffstat (limited to 'test/rexml')
-rw-r--r--test/rexml/test_elements.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/rexml/test_elements.rb b/test/rexml/test_elements.rb
index b7c7c267ed..e5e209ecdc 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_to_a
doc = Document.new '<a>sean<b/>elliott<c/></a>'
assert_equal 2, doc.root.elements.to_a.size