mt940 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/mt940/base.rb +1 -1
- data/lib/mt940.rb +1 -0
- data/mt940.gemspec +1 -1
- data/test/test_mt940_base.rb +11 -0
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.1
|
data/lib/mt940/base.rb
CHANGED
data/lib/mt940.rb
CHANGED
data/mt940.gemspec
CHANGED
data/test/test_mt940_base.rb
CHANGED
@@ -15,6 +15,17 @@ class TestMt940Base < Test::Unit::TestCase
|
|
15
15
|
assert_equal 6, @transactions.size
|
16
16
|
end
|
17
17
|
|
18
|
+
#Tempfile is used by Paperclip, so the following will work:
|
19
|
+
#MT940::Base.transactions(@mt940_file.attachment.to_file)
|
20
|
+
should 'read the transactions with the handle of a Tempfile' do
|
21
|
+
file = Tempfile.new('temp')
|
22
|
+
file.write(':940:')
|
23
|
+
file.rewind
|
24
|
+
@transactions = MT940::Base.transactions(file)
|
25
|
+
assert_equal 0, @transactions.size
|
26
|
+
file.unlink
|
27
|
+
end
|
28
|
+
|
18
29
|
should 'raise an exception if the file does not exist' do
|
19
30
|
file_name = File.dirname(__FILE__) + '/fixtures/123.txt'
|
20
31
|
assert_raise Errno::ENOENT do
|