Sha256: f06866e893386407d8d22c5646d27e3730e977012ff819653af5b4c7c5b822b7

Contents?: true

Size: 962 Bytes

Versions: 5

Compression:

Stored size: 962 Bytes

Contents

require 'helper'
require 'peddler/client'

class PeddlerClientTest < MiniTest::Test
  def setup
    @klass = Class.new(Peddler::Client)
    @client = @klass.new('US', 'key', 'secret', 'merchant_id')
  end

  def test_configures_path
    @klass.path('Foo')
    assert @client.aws_endpoint.match(/Foo$/)
  end

  def test_has_user_agent
    refute @client.connection.data[:headers].empty?
  end

  def test_returns_marketplace_ids
    refute_equal @client.marketplace_id('US'), @client.marketplace_id('GB')
  end

  def test_returns_default_marketplace_id
    assert_equal @client.marketplace_id, @client.marketplace_id('US')
  end

  def test_inherits_parent_params
    assert_equal Peddler::Client.params, @klass.params
  end

  def test_defines_constants_on_service
    refute_nil @klass.const_get(:HOSTS)
  end

  def test_has_a_key
    refute_nil @client.aws_access_key_id
  end

  def test_has_a_secret
    refute_nil @client.aws_secret_access_key
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
peddler-0.6.5 test/peddler/test_client.rb
peddler-0.6.4 test/peddler/test_client.rb
peddler-0.6.3 test/peddler/test_client.rb
peddler-0.6.2 test/peddler/test_client.rb
peddler-0.6.1 test/peddler/test_client.rb