Skip to content

Instantly share code, notes, and snippets.

@titanous
Created January 24, 2011 15:16
Show Gist options
  • Save titanous/793352 to your computer and use it in GitHub Desktop.
Save titanous/793352 to your computer and use it in GitHub Desktop.
require 'active_merchant'
require 'test/unit'
class CreditCardThing < Struct.new(:number, :month, :year, :type)
include ActiveMerchant::Billing::CreditCardMethods
def valid_number?
self.class.valid_number?(number)
end
end
class CreditCardMethodsTest < Test::Unit::TestCase
def test_credit_card_methods
cc = CreditCardThing.new('4012888888881881', '11', '2015', 'visa')
assert cc.valid_number?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment