Sha256: d2e1b74fdd09d897836d71a71bae9c6b2707cc31576731c6b1f969f884904147

Contents?: true

Size: 986 Bytes

Versions: 2

Compression:

Stored size: 986 Bytes

Contents

require_relative 'spec_helper'

describe BankgiroInbetalningar, ".parse" do
  context "parsing a minimal file" do
    subject { BankgiroInbetalningar.parse(fixture_path('minimal.txt')) }

    it "finds the timestamp" do
      subject.timestamp.should == "2004 05 25 173035 010331".gsub(' ','').to_i
    end
    it "finds 1 deposit" do
      subject.deposits.count.should == 1
    end
    it "finds 1 payment" do
      subject.deposits.first.payments.count.should == 1
    end
  end
end

describe BankgiroInbetalningar, ".parse_data" do
  context "parsing a minimal file" do
    let(:data) { File.read(fixture_path('minimal.txt')) }
    subject { BankgiroInbetalningar.parse_data(data) }

    it "finds the timestamp" do
      subject.timestamp.should == "2004 05 25 173035 010331".gsub(' ','').to_i
    end
    it "finds 1 deposit" do
      subject.deposits.count.should == 1
    end
    it "finds 1 payment" do
      subject.deposits.first.payments.count.should == 1
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bankgiro_inbetalningar-1.1.1 spec/bankgiro_inbetalningar_spec.rb
bankgiro_inbetalningar-1.1.0 spec/bankgiro_inbetalningar_spec.rb