spec/reckon/app_spec.rb in reckon-0.2.2 vs spec/reckon/app_spec.rb in reckon-0.2.3
- old
+ new
@@ -15,10 +15,16 @@
describe "columns" do
it "should return the csv transposed" do
@simple_csv.columns.should == [["entry1", "entry4"], ["entry2", "entry5"], ["entry3", "entry6"]]
@chase.columns.length.should == 4
end
+
+ it "should be ok with empty lines" do
+ lambda {
+ Reckon::App.new(:string => "one,two\nthree,four\n\n\n\n\n").columns.should == [['one', 'three'], ['two', 'four']]
+ }.should_not raise_error
+ end
end
describe "detect_columns" do
before do
@harder_date_example_csv = Reckon::App.new(:string => HARDER_DATE_EXAMPLE)
@@ -101,10 +107,9 @@
it "should work on non-adjacent columns" do
@simple_csv.merge_columns(0,2).should == [["entry1 entry3", "entry4 entry6"], ["entry2", "entry5"]]
end
end
-
# Data
SIMPLE_CSV = "entry1,entry2,entry3\nentry4,entry5,entry6"