csvlint 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MmYzODNiNTQyMTQ0OTNkZTQ1NGQwMzkwNmRkYWMxODNiNTIwNjNhMA==
4
+ Zjg3NDc5YjI0ZGYwOGFkNzVkOWVlNWQ0NDgyNDhjMDRmN2Y2ZmY0OQ==
5
5
  data.tar.gz: !binary |-
6
- NzNhZDQ1NmY1Njc5MDMyZjVlYTNiOTc4Y2YxZGRlNjVmNjJiMDFlYw==
6
+ ZjZhYWNlYWE5NDlkYWI4ZjZmMmFmYmNlN2Y1M2NhNDY5YTg1M2RiMw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MTVlYjFlN2YxYzViNzEyOTg0MTk4ZTgzY2Q3Mzk2ZGE0NTllNjFlZjE0ODg4
10
- ZTUwZTdjNTA0MWNmOTUyMjBjZjVmNGMyYjc1MmUxYjllMDIwYTVjYTg5ZTVm
11
- NmEyMjAzZGVhMzI2NGUwYTI2YzAzZjcyODViYmEyYzVlNWMyZmE=
9
+ ZmM1OWFlODNiMzE5MWY4MmIxM2NjM2NjYzk4NThjNzQxM2EwNzRmODNlNWMy
10
+ ODA1YzJhZTEyNzc1ODA4ZjdjODk2ZWQwMTFjNWI5YWYzY2Y2ZjNjMjI3NGI2
11
+ YzhmMGY5MDViYzc1NTYwYzUxZGU2MDFhYWI4MjEyOGEyMTg4YzE=
12
12
  data.tar.gz: !binary |-
13
- ZTU5ZjQzNDZkMWVhZTBkODAwNGFmMzM5ODZhMmMzODQ3ZTg3YzRiMGM2YzEz
14
- MGE4M2VjZTIzODgwODM5MTY4MjEwM2M0N2NkZjIwY2VmNTk3Y2RmMWNmMTBl
15
- NGM4MzU1MzVhOWQyMWEzM2JkZWQ1ODlkMzgyYTZlNTE3ZWI5MTc=
13
+ MjYyNjgzNWY1YzJkMDZhZGM3NzQ4YzE4NjczZTU0NmNiZjgyOWYxM2M0MjAz
14
+ NjkyZDhmYjJlOGI2OWZhNzI4MmQ2N2IzMjY5ZTllYjg4N2RhN2E4ZGEyYjgz
15
+ MjdkMDMyOWU5OTg2OWViY2NmZmU5NTQyNzZmODY2OGIzMTQ0ZTU=
@@ -17,7 +17,7 @@ Feature: CSVlint CLI
17
17
 
18
18
  # This is a hacky way of saying to run `cat features/fixtures/valid.csv | csvlint`
19
19
  Scenario: Valid CSV from pipe
20
- Given I have stubbed ARGF to contain "features/fixtures/valid.csv"
20
+ Given I have stubbed stdin to contain "features/fixtures/valid.csv"
21
21
  When I run `csvlint`
22
22
  Then the output should contain "CSV is VALID"
23
23
 
@@ -35,11 +35,13 @@ Feature: CSVlint CLI
35
35
  Then the output should contain "non-existent-file.csv not found"
36
36
 
37
37
  Scenario: No file or URL specified
38
+ Given I have stubbed stdin to contain nothing
38
39
  When I run `csvlint`
39
40
  Then the output should contain "No CSV data to validate"
40
41
 
41
42
  Scenario: No file or URL specified, but schema specified
42
- Given I have a schema with the following content:
43
+ Given I have stubbed stdin to contain nothing
44
+ And I have a schema with the following content:
43
45
  """
44
46
  {
45
47
  "fields": [
@@ -198,7 +200,8 @@ NO JSON HERE SON
198
200
  And the output should contain "1. min_length. Row: 2,2. 5"
199
201
 
200
202
  Scenario: CSVw table Schema
201
- Given I have a metadata file called "csvw/countries.json"
203
+ Given I have stubbed stdin to contain nothing
204
+ And I have a metadata file called "csvw/countries.json"
202
205
  And the metadata is stored at the url "http://w3c.github.io/csvw/tests/countries.json"
203
206
  And I have a file called "csvw/countries.csv" at the url "http://w3c.github.io/csvw/tests/countries.csv"
204
207
  And I have a file called "csvw/country_slice.csv" at the url "http://w3c.github.io/csvw/tests/country_slice.csv"
@@ -1,5 +1,9 @@
1
- Given(/^I have stubbed ARGF to contain "(.*?)"$/) do |file|
2
- expect(ARGF).to receive(:read).and_return(File.read(file))
1
+ Given(/^I have stubbed stdin to contain "(.*?)"$/) do |file|
2
+ expect(STDIN).to receive(:read).and_return(File.read(file))
3
+ end
4
+
5
+ Given(/^I have stubbed stdin to contain nothing$/) do
6
+ expect(STDIN).to receive(:read).and_return(nil)
3
7
  end
4
8
 
5
9
  Then(/^nothing should be outputted to STDERR$/) do
@@ -31,7 +31,7 @@ module Csvlint
31
31
  if source.nil?
32
32
  # If no source is present, try reading from stdin
33
33
  if !$stdin.tty?
34
- source = StringIO.new(ARGF.read) rescue nil
34
+ source = StringIO.new(STDIN.read) rescue nil
35
35
  return_error "No CSV data to validate" if !options[:schema] && source.nil?
36
36
  end
37
37
  else
@@ -1,3 +1,3 @@
1
1
  module Csvlint
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csvlint
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - pezholio
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-20 00:00:00.000000000 Z
11
+ date: 2015-11-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types