data_spec 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b79b98a6f53064229c53780fd01191330c150ad6
4
- data.tar.gz: 8a8956b12f0275bf4d7382bc581d7b7b10489b76
3
+ metadata.gz: 5d743dff97cb583826480de5f7247583ca3c595a
4
+ data.tar.gz: 80dd7b490ee0e85434af7b738a76ea7e85f1556d
5
5
  SHA512:
6
- metadata.gz: 94562eec7f447ad849ee5bd83e53f9cdd3d0e2ad8f40c9066cf892ff181c0bf3b887cd57e65e3df6dfb435753ea643a81ade068dcf0d09261ec3b5796bda816b
7
- data.tar.gz: aabe115c6e36327812531afa444d5215e49000ec91c637872083711015572bf25f2e2ba786f7ac907d54d7b56fcfbadba1d9eec7efdcc41ca7f096c5ec881728
6
+ metadata.gz: d163a15da3f0cdc5ebf18cfb7a8e3a9e46b3acfc7eb4f84765f837d46a5235810b34800c1e9437254d40c560db327ff69c9af8fd1b32d7ef24c552b717ba514d
7
+ data.tar.gz: 217ce499aba7c3b1a57893b6fa3bb3bb5f38ac8ac037bc73a51544371b2a78d951be93f2bff904ad9ef7ec6acf22b2aebb419e986d77c4776cd794976086bf14
data/README.md CHANGED
@@ -87,11 +87,14 @@ Given the data is:
87
87
  - bacon
88
88
  - 1
89
89
  - 2013-07-06 20:09:32.824102000 -07:00
90
+ - "https://www.google.com/images/srpr/logo4w.png"
90
91
  """
91
92
  Then the data at "0" should be of type String
92
93
  Then the data at "1" should be of type Fixnum
93
94
  Then the data at "2" should be of type Time
95
+ Then the data at "3" should be of type URI
94
96
  ```
97
+ Note: Checking a URI involves actually fetching the URI
95
98
 
96
99
  Use embedded code:
97
100
  ```ruby
@@ -109,6 +109,7 @@ Feature: Core Steps
109
109
  string: bacon
110
110
  hash: {}
111
111
  array: []
112
+ url: "https://www.google.com/images/srpr/logo4w.png"
112
113
  """
113
114
  Then the data at "date" should be of type Time
114
115
  And the data at "fixnum" should be of type Fixnum
@@ -116,3 +117,5 @@ Feature: Core Steps
116
117
  And the data at "string" should be of type String
117
118
  And the data at "hash" should be of type Hash
118
119
  And the data at "array" should be of type Array
120
+ And the data at "url" should be of type URI
121
+ #Note: ^^ Actually fetches the URL
@@ -1,6 +1,7 @@
1
1
  require File.expand_path("../../data_spec", __FILE__)
2
2
  require 'data_spec'
3
3
  require 'time'
4
+ require 'open-uri'
4
5
 
5
6
  World(DataSpec::Helpers, DataSpec::Matchers)
6
7
 
@@ -31,6 +32,8 @@ Then(/^the data at "(.*?)" should be of type ([A-Za-z]+)$/) do |path, type|
31
32
  #JSON doesn't actually interpret a time string into a Time,
32
33
  # YAML will, but Time doesn't parse a Time object
33
34
  data.should match_block(lambda{|item| Time.parse(item.to_s).is_a? Time}).at(path)
35
+ elsif type == "URI"
36
+ expect { open(DataSpec::Helpers.at_path(data, path)) }.to_not raise_error
34
37
  else
35
38
  data.should match_block(lambda{|item| item.is_a? Object.const_get(type)}).at(path)
36
39
  end
@@ -1,3 +1,3 @@
1
1
  module DataSpec
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: data_spec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - narfanator