diff --git a/tests/test_round_trip.rb b/tests/test_round_trip.rb index b637e9f..e796d2c 100644 --- a/tests/test_round_trip.rb +++ b/tests/test_round_trip.rb @@ -33,6 +33,27 @@ class RoundTripTest < Test::Unit::TestCase assert true end + def self.create_test_for_round_trip_files_in_dir(dir) + names = Dir[File.join(dir, '*.xson')].collect {|f| File.basename(f).sub(/\.xson$/, '') } + names.each { |name| + eval < ex - $stderr.puts "failure while round-tripping (A) #{dir}/#{name}" # DEBUG - File.open(File.join(dir, "#{name}_out_a.bson"), 'wb') { |f| # DEBUG - bson_from_ruby.each { |b| f.putc(b) } - } +# File.open(File.join(dir, "#{name}_out_a.bson"), 'wb') { |f| # DEBUG +# bson_from_ruby.each { |b| f.putc(b) } +# } raise ex end @@ -100,10 +105,9 @@ class RoundTripTest < Test::Unit::TestCase assert_equal bson.length, bson_from_ruby.length assert_equal bson, bson_from_ruby rescue => ex - $stderr.puts "failure while round-tripping (B) #{dir}/#{name}" # DEBUG - File.open(File.join(dir, "#{name}_out_b.bson"), 'wb') { |f| # DEBUG - bson_from_ruby.each { |b| f.putc(b) } - } +# File.open(File.join(dir, "#{name}_out_b.bson"), 'wb') { |f| DEBUG +# bson_from_ruby.each { |b| f.putc(b) } +# } raise ex end }