Sha256: 76e93986a7416d9ada928e0f5ae9df1344e20559d655e21f0031c5863827605f
Contents?: true
Size: 819 Bytes
Versions: 2
Compression:
Stored size: 819 Bytes
Contents
require 'helper' require File.join(File.expand_path(File.dirname(__FILE__)), '..', 'lib', 'csv2json.rb') # this form is important for local development class TestCsv2json < Test::Unit::TestCase should "parse some test files" do fixtures_dir = File.expand_path(File.join(File.dirname(__FILE__), 'fixtures')) Dir.chdir(fixtures_dir) do Dir.glob('*.csv') do |filename| json_template = File.basename(filename, ".csv")+'.json' File.open(filename, "r") do |input| output = StringIO.new() CSV2JSON.parse(input, output) template = File.read(json_template) output.pos = 0 assert template == output.read end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
csv2json-0.1.1 | test/test_csv2json.rb |
csv2json-0.1.0 | test/test_csv2json.rb |