Sha256: ebb02ea8e48a6a4b0c142e15b1300e5537f6dc6609412c7ed68279e61a8d21fc

Contents?: true

Size: 496 Bytes

Versions: 6

Compression:

Stored size: 496 Bytes

Contents

require 'test/unit'
require 'iz'

class TestCreditCard < Test::Unit::TestCase

  def valid_credit_cards
    ['4242424242424242']
  end

  def invalid_credit_cards
    [nil, false, -1, '', '    ', '424242424242']
  end

  def test_that_credit_card_values_return_true
    valid_credit_cards.each do |cc|
      assert Iz.credit_card?(cc)
    end
  end

  def test_that_invalid_credit_card_values_return_false
    invalid_credit_cards.each do |cc|
      assert !Iz.credit_card?(cc)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
iz-0.3.1 test/test_credit_card.rb
iz-0.3.0 test/test_credit_card.rb
iz-0.2.1 test/test_credit_card.rb
iz-0.2.0 test/test_credit_card.rb
iz-0.1.0 test/test_credit_card.rb
iz-0.0.1 test/test_credit_card.rb