Sha256: 86f49a09b22f35b9068bd4ba5af438415a7cc85f7e556e1d4dfea25a3b26181b
Contents?: true
Size: 1.7 KB
Versions: 6
Compression:
Stored size: 1.7 KB
Contents
require File.join(File.dirname(__FILE__), "/../spec_helper") require 'etl/xml_et' describe XML::ET do before do @xml_file = File.expand_path("#{File.dirname(__FILE__)}/../fixtures/test_file.xml") end # I don't know if I want to make this just like csv_et. What I'll do is finish the scorm stuff, then come back. end # before do # @csv_file = File.expand_path("#{File.dirname(__FILE__)}/../fixtures/test_file.csv") # end # # it "should be able to transform a csv file into an array of arrays" do # @etl = CSV::ET.process(:source => @csv_file) # @etl.data.should be_is_a(Array) # @etl.data.size.should eql(3) # @etl.data.first.should eql(["some", "data", "here"]) # @etl.data.last.should eql([4,5,6]) # end # # it "should be able to transforrm csv data into an array of arrays" do # content = File.read(@csv_file) # @etl = CSV::ET.process(:source => content) # @etl.data.should be_is_a(Array) # @etl.data.size.should eql(3) # @etl.data.first.should eql(["some", "data", "here"]) # @etl.data.last.should eql([4,5,6]) # end # # it "should be able to pull the header out of the extracted data" do # @etl = CSV::ET.process(:source => @csv_file, :extract_header => true) # @etl.header.should eql(["some", "data", "here"]) # @etl.data.first.should eql([1,2,3]) # end # # it "should be able to use the FasterCSV options" do # FasterCSV::Converters[:foo] = lambda{|f| :foo } # @etl = CSV::ET.process( # :source => @csv_file, # :extract_header => true, # :parse_with => {:converters => :foo} # ) # @etl.header.should eql([:foo, :foo, :foo]) # @etl.data.first.should eql([:foo, :foo, :foo]) # end # end
Version data entries
6 entries across 6 versions & 1 rubygems