Sha256: 5c94a9d3bc3b85ee881af6ed5f606ae48081da8a94490ebf17b67b4d35c20066

Contents?: true

Size: 796 Bytes

Versions: 7

Compression:

Stored size: 796 Bytes

Contents

# frozen_string_literal: true

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-2.0.4 test/unit/peddler/errors/test_parser.rb
peddler-2.0.3 test/unit/peddler/errors/test_parser.rb
peddler-2.0.0 test/unit/peddler/errors/test_parser.rb
peddler-1.6.7 test/unit/peddler/errors/test_parser.rb
peddler-1.6.6 test/unit/peddler/errors/test_parser.rb
peddler-1.6.5 test/unit/peddler/errors/test_parser.rb
peddler-1.6.4 test/unit/peddler/errors/test_parser.rb