Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rexml/source.rb
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def read(term = nil, min_bytes = 1)
end
true
rescue Exception, NameError
@source = nil
@source = StringIO.new
false
end
end
Expand Down
6 changes: 6 additions & 0 deletions test/test_document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,12 @@ def test_xml_declaration_standalone
assert_equal('no', doc.stand_alone?, bug2539)
end

def test_no_trailing_newline
assert_nothing_raised do
REXML::Document.new("<?xml version=\"1.0\"?>\n<!DOCTYPE coverage SYSTEM \"http://cobertura.sourceforge.net/xml/coverage-04.dtd\">\n<!-- Generated by simplecov-cobertura version 3.0.0 (https://github.com/jessebs/simplecov-cobertura) -->")
end
end

def test_each_recursive
xml_source = <<~XML
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
Expand Down
Loading