Sha256: d26223194437756c9e022954b90e8184452080cc958bbb7a2c8aa746768f2a09

Contents?: true

Size: 941 Bytes

Versions: 2

Compression:

Stored size: 941 Bytes

Contents

require 'helper'

class TestMt940Triodos < Test::Unit::TestCase

  def setup
    file_name = File.dirname(__FILE__) + '/fixtures/triodos.txt'
    @transactions = MT940::Base.transactions(file_name)
    @transaction = @transactions.first
  end
  
  should 'have the correct number of transactions' do
    assert_equal 2, @transactions.size
  end

  context 'Transaction' do
    should 'have a bank_account' do
      assert_equal '0390123456', @transaction.bank_account
    end

    should 'have an amount' do
      assert_equal -15.7, @transaction.amount
    end

    should 'have a description' do
      assert_equal '0000000000000 ALGEMENE TUSSENREKENING KOSTEN VAN 01-10-2010 TOT EN M ET 31-12-20100390123456', @transaction.description
    end

    should 'have a date' do
      assert_equal Date.new(2011,1,1), @transaction.date
    end

    should 'return its bank' do
      assert_equal 'Triodos', @transaction.bank
    end

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mt940-0.5.1 test/test_mt940_triodos.rb
mt940-0.5.0 test/test_mt940_triodos.rb