test/unit/peddler/test_xml_parser.rb in peddler-0.16.0 vs test/unit/peddler/test_xml_parser.rb in peddler-0.17.0

- old
+ new

@@ -1,25 +1,26 @@ require 'helper' require 'peddler/xml_parser' class TestPeddlerXMLParser < MiniTest::Test def setup - body = '<Response><Result><NextToken>123</NextToken>'\ - '<Foo>Bar</Foo></Result></Response>' + body = '<Foo>Bar</Foo>' + res = OpenStruct.new( body: body, - headers: { 'Content-Type' => 'text/xml', 'Content-Length' => '78' } + headers: { + 'Content-Type' => 'text/xml', + 'Content-Length' => body.size.to_s + } ) @parser = Peddler::XMLParser.new(res) end - def test_parses_data - assert_equal 'Bar', @parser.parse['Foo'] - end - - def test_next_token - assert_equal '123', @parser.next_token + def test_does_not_implement_parsing + assert_raises NotImplementedError do + @parser.parse + end end def test_validates assert @parser.valid? end