Sha256: 48bf7d8e3bc8ed7a16cd06d6a69dbc8010dc1bebb9d779d5a84319eb11ee82cb

Contents?: true

Size: 582 Bytes

Versions: 2

Compression:

Stored size: 582 Bytes

Contents

require 'test_helper'

class CreditCardFormattingTest < Test::Unit::TestCase
  include AbtainBilling::Billing::CreditCardFormatting
  
  def test_should_format_number_by_rule
    assert_equal 2005, format(2005, :steven_colbert)
    
    assert_equal '0005', format(05, :four_digits)
    assert_equal '2005', format(2005, :four_digits)
    
    assert_equal '05', format(2005, :two_digits)
    assert_equal '05', format(05, :two_digits)
    assert_equal '08', format(8, :two_digits)
    
    assert format(nil, :two_digits).blank?
    assert format('', :two_digits).blank?
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
abtain_billing-1.03 test/unit/credit_card_formatting_test.rb
abtain_billing-1.02 test/unit/credit_card_formatting_test.rb