Skip to content

Commit

Permalink
test tree-parser: move common method to base class
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Aug 17, 2024
1 parent 6e00a14 commit 35e1681
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions test/parser/test_tree.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@

module REXMLTests
class TestTreeParser < Test::Unit::TestCase
private def parse(xml)
document = REXML::Document.new
parser = REXML::Parsers::TreeParser.new(xml, document)
parser.parse
end

class TestInvalid < self
def test_unmatched_close_tag
xml = "<root></not-root>"
Expand All @@ -31,13 +37,6 @@ def test_no_close_tag
Last 80 unconsumed characters:
MESSAGE
end

private
def parse(xml)
document = REXML::Document.new
parser = REXML::Parsers::TreeParser.new(xml, document)
parser.parse
end
end
end
end

0 comments on commit 35e1681

Please sign in to comment.