Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Tree: 4a00971acc
Fetching contributors…

Cannot retrieve contributors at this time

28 lines (22 sloc) 0.498 kB
require 'test_helper'
class ParserTest < Test::Unit::TestCase
should "default to REXMLParser" do
Crack::XML.parser.should == Crack::REXMLParser
end
context "with a custom Parser" do
class CustomParser
def self.parse(xml)
xml
end
end
setup do
Crack::XML.parser = CustomParser
end
should "use the custom Parser" do
Crack::XML.parse("<xml/>").should == "<xml/>"
end
teardown do
Crack::XML.parser = nil
end
end
end
Jump to Line
Something went wrong with that request. Please try again.