test/tc_factory_997.rb in X12-0.0.5 vs test/tc_factory_997.rb in X12-0.1.0
- old
+ new
@@ -22,14 +22,14 @@
#++
#
require 'x12'
require 'test/unit'
-class TestFactory < Test::Unit::TestCase
+class Test997Factory < Test::Unit::TestCase
@@p = nil
-RESULT=<<-EOT
+tmp=<<-EOT
ST*997*2878~
AK1*HS*293328532~
AK2*270*~
AK3*NM1**L1000D~
AK4***55*Bad element~
@@ -42,12 +42,12 @@
AK5*666****999~
AK9****~
SE**~
EOT
- @@result = RESULT.gsub!(/\n/,'')
- TIMES = 1000
+ @@result = tmp.gsub!(/\n/,'')
+ @@times = 1000
def setup
unless @@p
@@p = X12::Parser.new('misc/997.d12')
end
@@ -118,13 +118,13 @@
assert_equal(@@result, @r.render)
end # test_all
def test_timing
start = Time::now
- TIMES.times do
+ @@times.times do
test_all
end
finish = Time::now
- puts "Factories per second: #{TIMES.to_f/(finish-start)}, elapsed: #{finish-start}"
+ puts "Factories per second, 997: #{@@times.to_f/(finish-start)}, elapsed: #{finish-start}"
end # test_timing
end # TestList