Sha256: e45008899988bbff8acce8fd4004549f3b9147bc723c1cbdb202af766292fd6e

Contents?: true

Size: 467 Bytes

Versions: 1

Compression:

Stored size: 467 Bytes

Contents

require 'helper'
require 'peddler/xml_parser'

class XMLParserTest < 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'})

    @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
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
peddler-0.7.6 test/unit/peddler/test_xml_parser.rb