Sha256: 74cdd0cb09fe453997671d610e29f0eb900b364a593f4af5484ef145c42c971b

Contents?: true

Size: 596 Bytes

Versions: 1

Compression:

Stored size: 596 Bytes

Contents

require 'test_helper'

class ExpiryDateTest < Test::Unit::TestCase
  def test_should_be_expired
    last_month = 2.months.ago
    date = CreditCard::ExpiryDate.new(last_month.month, last_month.year)
    assert date.expired?
  end
  
  def test_today_should_not_be_expired
    today = Time.now
    date = CreditCard::ExpiryDate.new(today.month, today.year)
    assert_false date.expired?
  end
  
  def test_dates_in_the_future_should_not_be_expired
    next_month = 1.month.from_now
    date = CreditCard::ExpiryDate.new(next_month.month, next_month.year)
    assert_false date.expired?
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tomriley-active_merchant-1.4.2.3 test/unit/expiry_date_test.rb