Sha256: 6076e0b99330fcac678d0da3d172b67345d3044f3bd310e40ee6b6bd0fb14c28

Contents?: true

Size: 765 Bytes

Versions: 7

Compression:

Stored size: 765 Bytes

Contents

require 'helper'
require 'peddler/errors/parser'

class TestPeddlerErrorsParser < MiniTest::Test
  def setup
    body = <<-XML
      <ErrorResponse>
        <Error>
          <Type>Foo</Type>
          <Code>Bar</Code>
          <Message>Baz</Message>
        </Error>
        <RequestID>123</RequestID>
      </ErrorResponse>
    XML
    res = OpenStruct.new(
      body: body,
      headers: {
        'Content-Type' => 'text/xml',
        'Content-Length' => body.size.to_s
      }
    )

    @parser = Peddler::Errors::Parser.new(res)
  end

  def test_parses_data
    assert @parser.parse
  end

  def test_has_a_message
    assert @parser.message
  end

  def test_has_code
    assert @parser.code
  end

  def test_has_type
    assert @parser.type
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
peddler-1.6.3 test/unit/peddler/errors/test_parser.rb
peddler-1.6.2 test/unit/peddler/errors/test_parser.rb
peddler-1.6.1 test/unit/peddler/errors/test_parser.rb
peddler-1.6.0 test/unit/peddler/errors/test_parser.rb
peddler-1.5.0 test/unit/peddler/errors/test_parser.rb
peddler-1.4.1 test/unit/peddler/errors/test_parser.rb
peddler-1.4.0 test/unit/peddler/errors/test_parser.rb