vcr-uri-catcher 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.MD +12 -8
- data/VERSION +1 -1
- data/features/library.feature +1 -1
- data/features/step_definitions/vcr-uri-catcher_steps.rb +1 -1
- data/lib/vcr-uri-catcher.rb +4 -3
- data/vcr-uri-catcher.gemspec +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b0b23a630faa42b6ee6ce29a6bdb6c778c68f69a
|
4
|
+
data.tar.gz: f6654654ddddd0fd03770e89de1f109f2c669c69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a206796b14b27ed71490b6a2ebda6fef7f60fbb7ffa76ce0c4d1a78f9a9db0b18e26f8e9dded68205f0ed74646020e4fc749419f5087b1988e97d6294b3d0cfd
|
7
|
+
data.tar.gz: 6c0c15552e0a3b8e26c4c5594195e5359b291b4cc77ff9f453fbf64c3a386af3d5cd0ad5f81385b55a584c234054b5cc9f9f2b69dee05777188e9c51d70205e3
|
data/README.MD
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
# vcr-uri-catcher
|
2
2
|
|
3
|
-
|
3
|
+
- ![Version](https://img.shields.io/gem/v/vcr-uri-catcher.svg?style=flat-square)
|
4
|
+
- ![Issues](https://img.shields.io/github/issues/mmolhoek/vcr-uri-catcher.svg)
|
5
|
+
- ![Forks] (https://img.shields.io/github/forks/mmolhoek/vcr-uri-catcher.svg)
|
6
|
+
- ![Licence](https://img.shields.io/badge/license-MIT-blue.svg)
|
7
|
+
|
8
|
+
I have been using [cucumber](https://cukes.info/) and [VCR](https://github.com/vcr/vcr) for quite a while now and what I was missing was a way to test network failures depite of the fact that those URI's were already recorded by [VCR](https://github.com/vcr/vcr).
|
4
9
|
This little gem provides just that.
|
5
10
|
|
6
11
|
## usage
|
@@ -43,12 +48,11 @@ end
|
|
43
48
|
```ruby
|
44
49
|
When(/^I visit one of the following uris:$/) do |uris|
|
45
50
|
uris.hashes.each do |row|
|
46
|
-
URICatcher::when_visiting(row[:
|
51
|
+
URICatcher::when_visiting(row[:uri])
|
47
52
|
end
|
48
53
|
end
|
49
54
|
```
|
50
|
-
> You can
|
51
|
-
> to tell the system the string is a Regexp. Handy for partial uri matching
|
55
|
+
> You can enter a string or a regular expression to describe your uri<br/>
|
52
56
|
|
53
57
|
```ruby
|
54
58
|
Given(/^I do:$/) do |code|
|
@@ -76,10 +80,6 @@ bundle
|
|
76
80
|
bundle exec cucumber
|
77
81
|
```
|
78
82
|
|
79
|
-
## todo
|
80
|
-
|
81
|
-
* much more tests
|
82
|
-
|
83
83
|
## Contributing to vcr-uri-catcher
|
84
84
|
|
85
85
|
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
|
@@ -90,6 +90,10 @@ bundle exec cucumber
|
|
90
90
|
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
91
91
|
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
92
92
|
|
93
|
+
## what else
|
94
|
+
|
95
|
+
* checkout [Jeweler](https://github.com/technicalpickles/jeweler), which I use for this project. Perfect for making your project management (gem building, deployement, etc a breeze)
|
96
|
+
|
93
97
|
## Copyright
|
94
98
|
|
95
99
|
Copyright (c) 2015 Mischa Molhoek. See LICENSE.txt for further details.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.5.0
|
data/features/library.feature
CHANGED
data/lib/vcr-uri-catcher.rb
CHANGED
@@ -3,7 +3,7 @@ class URICatcher
|
|
3
3
|
class NoBlockGiven < StandardError;end
|
4
4
|
class MissingVCR < StandardError;end
|
5
5
|
class MissingURI < StandardError;end
|
6
|
-
class
|
6
|
+
class NotAString < StandardError;end
|
7
7
|
def self.catcher
|
8
8
|
@catcher ||= Catcher.new
|
9
9
|
end
|
@@ -15,10 +15,11 @@ class URICatcher
|
|
15
15
|
end
|
16
16
|
end
|
17
17
|
def self.when_visiting(uri)
|
18
|
-
if uri.is_a?(String)
|
18
|
+
if uri.is_a?(String)
|
19
|
+
uri = Regexp.new(uri) if uri.scan(/\$|\^|{|}/).length > 0
|
19
20
|
self.catcher.when_visiting(uri)
|
20
21
|
else
|
21
|
-
raise
|
22
|
+
raise NotAString
|
22
23
|
end
|
23
24
|
end
|
24
25
|
end
|
data/vcr-uri-catcher.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: vcr-uri-catcher 0.
|
5
|
+
# stub: vcr-uri-catcher 0.5.0 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "vcr-uri-catcher"
|
9
|
-
s.version = "0.
|
9
|
+
s.version = "0.5.0"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|