csv-import-analyzer 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,5 @@
1
+ Year ID,Make ID,Model ID,Description ID,Price ID
2
+ 1997,Ford,E350,"ac, abs, moon","3000.00"
3
+ 1999,Chevy,"Venture ""Extended Edition""",,4900.00
4
+ 1999,"Chevy","Venture ""Extended Edition, Very Large""","",5000.00
5
+ 1996,Jeep,Grand Che'rokee,"MUST SELL!air, moon roof, loaded",4799.00
@@ -0,0 +1,5 @@
1
+ Year ID Make ID Model ID Description ID Price ID
2
+ 1997 Ford E350 'ac, abs, moon' "3000.00"
3
+ 1999 Chevy "Venture ""Extended Edition""" "" 4900.00
4
+ 1999 'Chevy' "Venture ""Extended Edition, Very Large""" 5000.00
5
+ 1996 Jeep Grand Che'rokee "MUST SELL!air, moon roof, loaded" 4799.00
@@ -42,6 +42,7 @@ describe "#identify_delimiter" do
42
42
  end
43
43
  end
44
44
 
45
+ # Testing private method, although we don't really have to
45
46
  describe "#return_plausible_delimiter" do
46
47
  before(:each) do
47
48
  @dummy_class = DummyClass.new
@@ -50,12 +51,12 @@ describe "#return_plausible_delimiter" do
50
51
 
51
52
  context "identifies delimiter" do
52
53
  it "returns comma as the delimiter by default" do
53
- expect(@dummy_class.return_plausible_delimiter).to eq(",")
54
+ expect(@dummy_class.send(:return_plausible_delimiter)).to eq(",")
54
55
  end
55
56
 
56
57
  it "returns semicolon as the delimiter for sample delimiter_count" do
57
58
  @dummy_class.stub(:delimiter_count).and_return(Hash[","=>15, ";"=>16, "\t"=>0, "|"=>0])
58
- expect(@dummy_class.return_plausible_delimiter).to eq(";")
59
+ expect(@dummy_class.send(:return_plausible_delimiter)).to eq(";")
59
60
  end
60
61
  end
61
62
  end
@@ -14,7 +14,6 @@ describe CsvImportAnalyzer::CsvSanitizer do
14
14
  let (:test) {"\"t1\", 't2', \"t3\""}
15
15
  let (:res) {"\"t1\", \"t2\", \"t3\""}
16
16
  xit "replaces single quotes to double quotes" do
17
- binding.pry
18
17
  expect(csv_sanitizer.send(:replace_line_single_quotes, test, ",")).to eq(res)
19
18
  end
20
19
  let (:test) {["t1","t2","",nil,"t3"]}
@@ -1,5 +1,5 @@
1
1
  Year ID,Make ID,Model ID,Description ID,Price ID
2
- 1997,Ford,,"ac, abs, moon","3000
3
- 1999,Chevy,"Venture ""Extended Edition""",",4900.00
2
+ 1997,Ford,,"ac, abs, moon","3000"
3
+ 1999,Chevy,"Venture ""Extended Edition""","",4900.00
4
4
  1999,'Chevy',"Venture ""Extended Edition, Very Large""",,5000.00
5
5
  1996,Jeep,Grand Che'rokee,"MUST SELL!air, moon roof, loaded",4799.00
@@ -2,7 +2,7 @@ require 'simplecov'
2
2
  # Must be ahead of requiring core library to start the code coverage.
3
3
  SimpleCov.start
4
4
  require 'csv-import-analyzer'
5
-
5
+ # $:<< File.join(File.dirname(__FILE__), '..')
6
6
  # Path to sample files in the fixtures folder that are made available to all specs for testing
7
7
  $sample_csv_path = "/home/avinash/Desktop/csv-import-analyzer/spec/fixtures/sample.csv"
8
8
  $sample_ssv_path = "/home/avinash/Desktop/csv-import-analyzer/spec/fixtures/semicolon-sample.csv"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csv-import-analyzer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Avinash Vallabhaneni
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-29 00:00:00.000000000 Z
11
+ date: 2014-10-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler