Sha256: eb1a1ee01b88e304abe17dd12ddd57d3ee9f671e9add99eddcace163fbbbb9ea

Contents?: true

Size: 625 Bytes

Versions: 11

Compression:

Stored size: 625 Bytes

Contents

require File.dirname(__FILE__) + '/../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

11 entries across 11 versions & 5 rubygems

Version Path
martinstannard-activemerchant-0.1.0 test/unit/expiry_date_test.rb
seamusabshere-active_merchant-1.4.2.1 test/unit/expiry_date_test.rb
seamusabshere-active_merchant-1.4.2.3 test/unit/expiry_date_test.rb
activemerchant-1.3.0 test/unit/expiry_date_test.rb
activemerchant-1.3.2 test/unit/expiry_date_test.rb
activemerchant-1.4.0 test/unit/expiry_date_test.rb
activemerchant-1.3.1 test/unit/expiry_date_test.rb
activemerchant-1.4.1 test/unit/expiry_date_test.rb
activemerchant-1.4.2 test/unit/expiry_date_test.rb
merb_merchant-1.4.1 test/unit/expiry_date_test.rb
spree-0.2.0 vendor/plugins/active_merchant/test/unit/expiry_date_test.rb