Sha256: 5c2fb970735d797bb21b3476dd5d3c7889f495bc74b09e7db74513334bcb7896
Contents?: true
Size: 855 Bytes
Versions: 5
Compression:
Stored size: 855 Bytes
Contents
require_relative 'test_helper' require 'yaml' # $DEBUG = true class TestMt940 < Test::Unit::TestCase def test_it_should_parse_fixture_files_correctly Dir[File.dirname(__FILE__) + "/fixtures/*.txt"].reject { |f| f =~ /sepa_snippet/ }.each do |file| data = MT940.parse(IO.read(file)) generated_structure_file = file.gsub(/.txt$/, ".yml") assert_equal YAML::load_file(generated_structure_file).to_yaml, data.to_yaml end end def test_it_takes_any_encoding_and_returns_binary file = File.dirname(__FILE__) + "/fixtures/with_binary_character.txt" binary_file = MT940.parse(IO.read(file).force_encoding("ISO-8859-15")) utf8_file = MT940.parse(IO.read(file).force_encoding("UTF-8")) [binary_file, utf8_file].each do |file| assert_equal file.last.last.reference.encoding.name, "UTF-8" end end end
Version data entries
5 entries across 5 versions & 1 rubygems