Sha256: a3da263228d7abe163af8c799858202a34eb694329fcd15516a2dbcc019c4a55

Contents?: true

Size: 772 Bytes

Versions: 1

Compression:

Stored size: 772 Bytes

Contents

require 'helper'
require 'peddler/marketplace'

class TestPeddlerMarketplace < MiniTest::Test
  def setup
    @marketplace = Peddler::Marketplace.new('ATVPDKIKX0DER')
  end

  def test_has_a_country_code
    assert @marketplace.country_code
  end

  def test_has_a_host
    assert @marketplace.host
  end

  def test_has_an_encoding
    assert @marketplace.encoding
  end

  def test_guard_against_missing_marketplace_id
    assert_raises(Peddler::Marketplace::BadId, 'missing MarketplaceId') do
      Peddler::Marketplace.new(nil)
    end
  end

  def test_guard_against_bad_marketplace_id
    assert_raises(Peddler::Marketplace::BadId, '"123" is not a valid MarketplaceId') do
      marketplace = Peddler::Marketplace.new('123')
      marketplace.host
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
peddler-1.6.3 test/unit/peddler/test_marketplace.rb