Sha256: ff0edc5eb219a21e072398564148ca84b50bf0e36f71022c20f4de50c8cf8c46

Contents?: true

Size: 806 Bytes

Versions: 4

Compression:

Stored size: 806 Bytes

Contents

# frozen_string_literal: true

require 'integration_helper'
require 'mws/orders'
require 'peddler/errors/handler'

class TestErrors < IntegrationTest
  use 'Orders'

  def setup
    @previous_error_handler = MWS::Orders::Client.error_handler
    MWS::Orders::Client.error_handler = Peddler::Errors::Handler
    super
  end

  def teardown
    MWS::Orders::Client.error_handler = @previous_error_handler
    super
  end

  def test_invalid_key
    clients.each do |client|
      assert_raises(Peddler::Errors::InvalidAccessKeyId) do
        client.aws_access_key_id = 'foo'
        client.get_order('bar')
      end
    end
  end

  def test_request_throttled
    clients.each do |client|
      assert_raises(Peddler::Errors::RequestThrottled) do
        client.get_order('foo')
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
peddler-1.6.7 test/integration/test_errors.rb
peddler-1.6.6 test/integration/test_errors.rb
peddler-1.6.5 test/integration/test_errors.rb
peddler-1.6.4 test/integration/test_errors.rb