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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a7c6149ab2f54a6582c74ce8e96170397c3c686
4
- data.tar.gz: d0318f0db83881b3d4880da7a8355fed12677088
3
+ metadata.gz: b0b23a630faa42b6ee6ce29a6bdb6c778c68f69a
4
+ data.tar.gz: f6654654ddddd0fd03770e89de1f109f2c669c69
5
5
  SHA512:
6
- metadata.gz: fc0a07b41cde680441441485fb0bd9ec20ebef83ce761c7faef7936ab0a2b5ff51e4d5e25f7eae7d10f0424616bcff2614e753a62da29cbf6c3e6b4da9c4bd7a
7
- data.tar.gz: 5421b932bbb68518b66a3e74c7b64617180e785e7ed74c6e52eb7163810b7683548dfbc610ab4592e68205babbf09368b0323200eb293339621f27dc23798452
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
- I have been using VCR for 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.
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[:regexp] == 'true' ? %r{#{row[:uri]}} : row[:uri])
51
+ URICatcher::when_visiting(row[:uri])
47
52
  end
48
53
  end
49
54
  ```
50
- > You can see you could add another table row containing a regexp boolean,<br/>
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.4.0
1
+ 0.5.0
@@ -18,4 +18,4 @@ Feature: Testing the libraries consistancy
18
18
  """ruby
19
19
  URICatcher::when_visiting([1,2,3])
20
20
  """
21
- Then I expect it to raise a URICatcher::NotStringOrRegexp error
21
+ Then I expect it to raise a URICatcher::NotAString error
@@ -4,7 +4,7 @@ end
4
4
 
5
5
  When(/^I visit one of the following uris:$/) do |uris|
6
6
  uris.hashes.each do |row|
7
- URICatcher::when_visiting(row[:regexp] == 'true' ? %r{#{row[:uri]}} : row[:uri])
7
+ URICatcher::when_visiting(row[:uri])
8
8
  end
9
9
  end
10
10
 
@@ -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 NotStringOrRegexp < StandardError;end
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) or uri.is_a?(Regexp)
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 NotStringOrRegexp
22
+ raise NotAString
22
23
  end
23
24
  end
24
25
  end
@@ -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.4.0 ruby lib
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.4.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"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vcr-uri-catcher
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mischa Molhoek