Sha256: bfa5ffc7b6691a189c357e18bb9fd6bc6fb480928ebbd13203a33e9457c4d606

Contents?: true

Size: 760 Bytes

Versions: 11

Compression:

Stored size: 760 Bytes

Contents

require 'helper'
require 'peddler/error_parser'

class TestPeddlerErrorParser < 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::ErrorParser.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

11 entries across 11 versions & 1 rubygems

Version Path
peddler-1.3.0 test/unit/peddler/test_error_parser.rb
peddler-1.2.0 test/unit/peddler/test_error_parser.rb
peddler-1.1.1 test/unit/peddler/test_error_parser.rb
peddler-1.1.0 test/unit/peddler/test_error_parser.rb
peddler-1.0.2 test/unit/peddler/test_error_parser.rb
peddler-1.0.1 test/unit/peddler/test_error_parser.rb
peddler-1.0.0 test/unit/peddler/test_error_parser.rb
peddler-0.19.0 test/unit/peddler/test_error_parser.rb
peddler-0.18.0 test/unit/peddler/test_error_parser.rb
peddler-0.17.1 test/unit/peddler/test_error_parser.rb
peddler-0.17.0 test/unit/peddler/test_error_parser.rb