Sha256: 40ea2d8c1a51093203499ecfc34e14b95f21b3bb4f29ee62d073e26d82b8e89c

Contents?: true

Size: 777 Bytes

Versions: 34

Compression:

Stored size: 777 Bytes

Contents

require 'test_helper'

class CountryCodeTest < Test::Unit::TestCase
  include ActiveMerchant

  def test_alpha2_country_code
    code = CountryCode.new('CA')
    assert_equal 'CA', code.value
    assert_equal 'CA', code.to_s
    assert_equal :alpha2, code.format
  end

  def test_lower_alpha2_country_code
    code = CountryCode.new('ca')
    assert_equal 'CA', code.value
    assert_equal 'CA', code.to_s
    assert_equal :alpha2, code.format
  end

  def test_alpha2_country_code
    code = CountryCode.new('CAN')
    assert_equal :alpha3, code.format
  end

  def test_numeric_code
    code = CountryCode.new('004')
    assert_equal :numeric, code.format
  end

  def test_invalid_code_format
    assert_raise(CountryCodeFormatError){ CountryCode.new('Canada') }
  end
end

Version data entries

34 entries across 34 versions & 11 rubygems

Version Path
smulube-activemerchant-1.5.1.3 test/unit/country_code_test.rb
smulube-activemerchant-1.5.1.2 test/unit/country_code_test.rb
ghazel-activemerchant-1.4.2 test/unit/country_code_test.rb
activemerchant-est-1.4.2.6 test/unit/country_code_test.rb
activemerchant-1.5.0 test/unit/country_code_test.rb
patmaddox-activemerchant-1.4.2.6 test/unit/country_code_test.rb
patmaddox-activemerchant-1.4.2.5 test/unit/country_code_test.rb
patmaddox-activemerchant-1.4.2.4 test/unit/country_code_test.rb
patmaddox-activemerchant-1.4.2.3 test/unit/country_code_test.rb
patmaddox-activemerchant-1.4.2.2 test/unit/country_code_test.rb
patmaddox-activemerchant-1.4.2.1 test/unit/country_code_test.rb
activemerchant-est-1.4.2.5 test/unit/country_code_test.rb
patmaddox-activemerchant-1.4.2 test/unit/country_code_test.rb
abtain_billing-1.0 test/unit/country_code_test.rb