Sha256: 258efa5c131e96c56e67735268dc2337f9488ff6ceddcb16c1c676b16fb7ecfb

Contents?: true

Size: 559 Bytes

Versions: 6

Compression:

Stored size: 559 Bytes

Contents

require 'helper'
require 'peddler/xml_response_parser'

class TestPeddlerXMLResponseParser < MiniTest::Test
  def setup
    body = '<Response><Result><NextToken>123</NextToken>'\
           '<Foo>Bar</Foo></Result></Response>'
    res = OpenStruct.new(
      body: body,
      headers: { 'Content-Type' => 'text/xml', 'Content-Length' => '78' }
    )

    @parser = Peddler::XMLResponseParser.new(res)
  end

  def test_parses_data
    assert_equal 'Bar', @parser.parse['Foo']
  end

  def test_next_token
    assert_equal '123', @parser.next_token
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
peddler-1.0.1 test/unit/peddler/test_xml_response_parser.rb
peddler-1.0.0 test/unit/peddler/test_xml_response_parser.rb
peddler-0.19.0 test/unit/peddler/test_xml_response_parser.rb
peddler-0.18.0 test/unit/peddler/test_xml_response_parser.rb
peddler-0.17.1 test/unit/peddler/test_xml_response_parser.rb
peddler-0.17.0 test/unit/peddler/test_xml_response_parser.rb