Skip to content

Commit

Permalink
Remove redundant test class
Browse files Browse the repository at this point in the history
  • Loading branch information
Watson1978 committed Jul 23, 2024
1 parent 8881bd5 commit 77b23ae
Showing 1 changed file with 15 additions and 17 deletions.
32 changes: 15 additions & 17 deletions test/parse/test_entity_declaration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,34 +145,32 @@ class TestParsedEntityDeclaration < self
class ParsedEntityDefinition < self
# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-PEDef
class TestEntityValue < self
class TestEntityValue < self
def test_no_quote
# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EntityValue
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY % valid-name invalid-entity-value > ]>')
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
def test_no_quote
# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EntityValue
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY % valid-name invalid-entity-value > ]>')
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Line: 1
Position: 63
Last 80 unconsumed characters:
% valid-name invalid-entity-value > ]>
DETAIL
end
DETAIL
end

def test_invalid_entity_value
# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EntityValue
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY % valid-name "% &" > ]>')
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
def test_invalid_entity_value
# https://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EntityValue
exception = assert_raise(REXML::ParseException) do
REXML::Document.new('<!DOCTYPE root [<!ENTITY % valid-name "% &" > ]>')
end
assert_equal(<<-DETAIL.chomp, exception.to_s)
Malformed entity declaration
Line: 1
Position: 48
Last 80 unconsumed characters:
% valid-name \"% &\" > ]>
DETAIL
end
DETAIL
end
end

Expand Down

0 comments on commit 77b23ae

Please sign in to comment.