cordawyn-iso8583 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/AUTHORS +2 -0
- data/CHANGELOG +5 -0
- data/LICENSE +21 -0
- data/README +27 -0
- data/Rakefile +127 -0
- data/TODO +10 -0
- data/lib/berlin.rb +82 -0
- data/lib/bitmap.rb +117 -0
- data/lib/codec.rb +189 -0
- data/lib/exception.rb +4 -0
- data/lib/field.rb +90 -0
- data/lib/fields.rb +148 -0
- data/lib/iso8583.rb +12 -0
- data/lib/message.rb +417 -0
- data/lib/util.rb +94 -0
- data/test/BitmapTests.rb +80 -0
- data/test/message_test.rb +163 -0
- data/test/test_codec.rb +97 -0
- data/test/test_fields.rb +188 -0
- data/test/test_util.rb +32 -0
- metadata +91 -0
data/test/test_util.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'lib/iso8583'
|
2
|
+
require 'test/unit'
|
3
|
+
|
4
|
+
include ISO8583
|
5
|
+
|
6
|
+
class UtilTest < Test::Unit::TestCase
|
7
|
+
def test_hex2b
|
8
|
+
assert_equal "\xab\xcd\x12", hex2b("abcd12")
|
9
|
+
assert_equal "\xab\xcd\x12", hex2b("a b c d 1 2")
|
10
|
+
assert_equal "\xab\xcd\x12", hex2b("ABCD12")
|
11
|
+
assert_raise(ISO8583Exception){
|
12
|
+
# non hex
|
13
|
+
hex2b("ABCDEFGH")
|
14
|
+
}
|
15
|
+
assert_raise(ISO8583Exception){
|
16
|
+
# odd num digits
|
17
|
+
hex2b("ABCDEF0")
|
18
|
+
}
|
19
|
+
end
|
20
|
+
|
21
|
+
def test_b2hex
|
22
|
+
assert_equal "abcd12", b2hex("\xab\xcd\x12")
|
23
|
+
end
|
24
|
+
|
25
|
+
def test_ebcdic2ascii
|
26
|
+
assert_equal "0123456789", ebcdic2ascii("\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9")
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_ascii2ebcdic
|
30
|
+
assert_equal "\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9", ascii2ebcdic("0123456789")
|
31
|
+
end
|
32
|
+
end
|
metadata
ADDED
@@ -0,0 +1,91 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: cordawyn-iso8583
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 31
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 2
|
10
|
+
version: 0.1.2
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Slava Kravchenko
|
14
|
+
- Tim Becker
|
15
|
+
autorequire:
|
16
|
+
bindir: bin
|
17
|
+
cert_chain: []
|
18
|
+
|
19
|
+
date: 2010-05-26 00:00:00 +03:00
|
20
|
+
default_executable:
|
21
|
+
dependencies: []
|
22
|
+
|
23
|
+
description: |
|
24
|
+
Ruby implementation of ISO 8583 financial messaging
|
25
|
+
|
26
|
+
email:
|
27
|
+
- cordawyn@gmail.com
|
28
|
+
- tim.becker@kuriositaet.de
|
29
|
+
executables: []
|
30
|
+
|
31
|
+
extensions: []
|
32
|
+
|
33
|
+
extra_rdoc_files: []
|
34
|
+
|
35
|
+
files:
|
36
|
+
- lib/berlin.rb
|
37
|
+
- lib/bitmap.rb
|
38
|
+
- lib/codec.rb
|
39
|
+
- lib/exception.rb
|
40
|
+
- lib/field.rb
|
41
|
+
- lib/fields.rb
|
42
|
+
- lib/iso8583.rb
|
43
|
+
- lib/message.rb
|
44
|
+
- lib/util.rb
|
45
|
+
- AUTHORS
|
46
|
+
- CHANGELOG
|
47
|
+
- LICENSE
|
48
|
+
- Rakefile
|
49
|
+
- README
|
50
|
+
- TODO
|
51
|
+
- test/BitmapTests.rb
|
52
|
+
- test/message_test.rb
|
53
|
+
- test/test_codec.rb
|
54
|
+
- test/test_fields.rb
|
55
|
+
- test/test_util.rb
|
56
|
+
has_rdoc: true
|
57
|
+
homepage: http://github.com/cordawyn/8583/
|
58
|
+
licenses: []
|
59
|
+
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options: []
|
62
|
+
|
63
|
+
require_paths:
|
64
|
+
- lib
|
65
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
66
|
+
none: false
|
67
|
+
requirements:
|
68
|
+
- - ">="
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
hash: 3
|
71
|
+
segments:
|
72
|
+
- 0
|
73
|
+
version: "0"
|
74
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
hash: 3
|
80
|
+
segments:
|
81
|
+
- 0
|
82
|
+
version: "0"
|
83
|
+
requirements:
|
84
|
+
- none
|
85
|
+
rubyforge_project: iso8583
|
86
|
+
rubygems_version: 1.3.7
|
87
|
+
signing_key:
|
88
|
+
specification_version: 3
|
89
|
+
summary: "iso8583: Ruby implementation of ISO 8583 financial messaging"
|
90
|
+
test_files: []
|
91
|
+
|