fake_http 0.1.0 → 0.2.1

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: f61ea5010682a14232d3b81aac1797c75255935a
4
- data.tar.gz: b811bbf26fb5c18d628e42aa1ea7197130759bd6
3
+ metadata.gz: 7d0e55ac0c96723a2d777bbde96d24d9a01738cf
4
+ data.tar.gz: 79defab86ee1abc93ec3139862896dfc6d2e4225
5
5
  SHA512:
6
- metadata.gz: 1a9d24702d7628f54d8cac226dfa2b10cda5b478405d7a28a6a1d3a6e90316e84c3914a9e008fecf2ab165b1fb68f87c66423e91f2f8cd047d2a0a5b4f17d028
7
- data.tar.gz: 924c8da4487f16bdc5940a4c8578a90a6f9e98059ba2364be7feb47d1c992ba33eb25efbc3bfb30e9c6dbc5d8c877097a1dd70e5464b9399811fbb7984b4f362
6
+ metadata.gz: 42ee0aee82cf8d4a8954462b2687ffd5d41ebf874a2352c16c51ea966788d531a6d2372786119457023f6741fff4d0acdc921fea19ca4d400ab7e650a0d0c27d
7
+ data.tar.gz: 117fee2cc88dac4fa597c836fbe7faca2004a2b96d1229db1d2a3e78e7047f157b1192b3cf18347d235f24603cc07f4d35a1a61840aa5b8da12e2da6980a5bf6
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  <!-- Tocer[start]: Auto-generated, don't remove. -->
6
6
 
7
- # Table of Contents
7
+ ## Table of Contents
8
8
 
9
9
  - [Features](#features)
10
10
  - [Screencasts](#screencasts)
@@ -39,15 +39,35 @@ class FakeHTTP
39
39
  end
40
40
 
41
41
  def get(pattern, &block)
42
- responder = Responder.new(pattern, block)
43
- @fakes[:get] << responder
42
+ add_responder(:get, pattern, &block)
43
+ end
44
+
45
+ def post(pattern, &block)
46
+ add_responder(:post, pattern, &block)
47
+ end
48
+
49
+ def put(pattern, &block)
50
+ add_responder(:put, pattern, &block)
51
+ end
52
+
53
+ def delete(pattern, &block)
54
+ add_responder(:delete, pattern, &block)
44
55
  end
45
56
 
46
57
  def request(verb, uri, options = {})
47
- responder = @fakes[verb].detect { |responder| responder.match(uri) }
58
+ path = URI.parse(uri).path
59
+ responder = @fakes[verb].detect { |responder| responder.match(path) }
60
+ raise "No responder defined for #{verb} #{uri}" unless responder
48
61
  responder.call(uri, options)
49
62
  end
50
63
 
64
+ private
65
+
66
+ def add_responder(verb, pattern, &block)
67
+ responder = Responder.new(pattern, block)
68
+ @fakes[verb] << responder
69
+ end
70
+
51
71
  end
52
72
 
53
73
  require "mustermann"
@@ -12,7 +12,7 @@ class FakeHTTP
12
12
  end
13
13
 
14
14
  def self.version
15
- "0.1.0"
15
+ "0.2.1"
16
16
  end
17
17
 
18
18
  def self.version_label
metadata CHANGED
@@ -1,29 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fake_http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Sadauskas
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-01-17 00:00:00.000000000 Z
11
+ date: 2017-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: http
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ">="
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '0'
19
+ version: '2'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ">="
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '0'
26
+ version: '2'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mustermann
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: '8.2'
61
+ version: '10.1'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: '8.2'
68
+ version: '10.1'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: pry
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -197,7 +197,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
197
197
  version: '0'
198
198
  requirements: []
199
199
  rubyforge_project:
200
- rubygems_version: 2.6.8
200
+ rubygems_version: 2.6.11
201
201
  signing_key:
202
202
  specification_version: 4
203
203
  summary: ''