require_relative '../test_helper'
module OhlohScm::Parsers
class SvnParserTest < OhlohScm::Test
def test_basic
assert_convert(SvnParser, DATA_DIR + '/simple.svn_log', DATA_DIR + '/simple.ohlog')
end
def test_empty_array
assert_equal([], SvnParser.parse(''))
end
def test_empty_xml
assert_equal("\n\n\n", SvnParser.parse('', :writer => XmlWriter.new))
end
def test_yield_instead_of_writer
commits = []
result = SvnParser.parse(File.read(DATA_DIR + '/simple.svn_log')) do |commit|
commits << commit.token
end
assert_nil result
assert_equal [5, 4, 3, 2, 1], commits
end
def test_log_parser
sample_log = <