http_stub 0.7.3 → 0.7.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -25,7 +25,7 @@ module HttpStub
25
25
  end
26
26
 
27
27
  def format_regexp(regexp)
28
- "regexp:#{regexp.source.gsub(/\\/, "")}"
28
+ "regexp:#{regexp.source.gsub(/\\\//, "/")}"
29
29
  end
30
30
 
31
31
  def format_hash(hash)
@@ -1,3 +1,3 @@
1
1
  module HttpStub
2
- VERSION = "0.7.3"
2
+ VERSION = "0.7.4"
3
3
  end
@@ -24,6 +24,16 @@ describe HttpStub::Configurer::Request::Regexpable do
24
24
  HttpStub::Configurer::Request::Regexpable.format(value).should end_with(".+?[a-z]")
25
25
  end
26
26
 
27
+ describe "and the regular expression contain escaped meta characters" do
28
+
29
+ let(:value) { /\^\+\[/ }
30
+
31
+ it "should return a string that retains the escape characters" do
32
+ HttpStub::Configurer::Request::Regexpable.format(value).should include("\\^\\+\\[")
33
+ end
34
+
35
+ end
36
+
27
37
  describe "and the regular expression contain path separators" do
28
38
 
29
39
  let(:value) { /\/some\/path/ }
@@ -189,15 +189,15 @@ describe HttpStub::Configurer, "when the server is running" do
189
189
 
190
190
  end
191
191
 
192
- describe "and the stub uri is regular expression" do
192
+ describe "and the stub uri is regular expression containing meta characters" do
193
193
 
194
194
  before(:each) do
195
- configurer.stub_response!(/\/stub\/regexp\/.*/, method: :get, response: { body: "Stub body" })
195
+ configurer.stub_response!(/\/stub\/regexp\/\$key=value/, method: :get, response: { body: "Stub body" })
196
196
  end
197
197
 
198
198
  describe "and a request is made whose uri matches the regular expression" do
199
199
 
200
- let(:response) { Net::HTTP.get_response("localhost", "/stub/regexp/match", 8001) }
200
+ let(:response) { Net::HTTP.get_response("localhost", "/match/stub/regexp/$key=value", 8001) }
201
201
 
202
202
  it "should respond with the stubbed body" do
203
203
  response.body.should eql("Stub body")
@@ -8,11 +8,11 @@ describe HttpStub::Models::RegexpableValue do
8
8
 
9
9
  describe "when the value is a string prefixed with 'regexp:'" do
10
10
 
11
- let(:value) { "regexp:^a[0-9]*z$" }
11
+ let(:value) { "regexp:^a[0-9]*\\$z$" }
12
12
 
13
13
  describe "and the provided value matches the regular expression" do
14
14
 
15
- let(:other_value) { "a789z" }
15
+ let(:other_value) { "a789$z" }
16
16
 
17
17
  it "should return true" do
18
18
  regexpable_value.match?(other_value).should be_true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http_stub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2013-04-18 00:00:00.000000000 Z
13
+ date: 2013-05-16 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: sinatra
@@ -19,7 +19,7 @@ dependencies:
19
19
  requirements:
20
20
  - - ~>
21
21
  - !ruby/object:Gem::Version
22
- version: 1.3.4
22
+ version: 1.3.6
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -27,7 +27,7 @@ dependencies:
27
27
  requirements:
28
28
  - - ~>
29
29
  - !ruby/object:Gem::Version
30
- version: 1.3.4
30
+ version: 1.3.6
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: sinatra-partial
33
33
  requirement: !ruby/object:Gem::Requirement
@@ -51,7 +51,7 @@ dependencies:
51
51
  requirements:
52
52
  - - ~>
53
53
  - !ruby/object:Gem::Version
54
- version: 4.0.0
54
+ version: 4.0.2
55
55
  type: :runtime
56
56
  prerelease: false
57
57
  version_requirements: !ruby/object:Gem::Requirement
@@ -59,7 +59,7 @@ dependencies:
59
59
  requirements:
60
60
  - - ~>
61
61
  - !ruby/object:Gem::Version
62
- version: 4.0.0
62
+ version: 4.0.2
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: sass
65
65
  requirement: !ruby/object:Gem::Requirement
@@ -67,7 +67,7 @@ dependencies:
67
67
  requirements:
68
68
  - - ~>
69
69
  - !ruby/object:Gem::Version
70
- version: 3.2.6
70
+ version: 3.2.9
71
71
  type: :runtime
72
72
  prerelease: false
73
73
  version_requirements: !ruby/object:Gem::Requirement
@@ -75,7 +75,7 @@ dependencies:
75
75
  requirements:
76
76
  - - ~>
77
77
  - !ruby/object:Gem::Version
78
- version: 3.2.6
78
+ version: 3.2.9
79
79
  - !ruby/object:Gem::Dependency
80
80
  name: rspec
81
81
  requirement: !ruby/object:Gem::Requirement
@@ -83,7 +83,7 @@ dependencies:
83
83
  requirements:
84
84
  - - ~>
85
85
  - !ruby/object:Gem::Version
86
- version: '2.12'
86
+ version: '2.13'
87
87
  type: :development
88
88
  prerelease: false
89
89
  version_requirements: !ruby/object:Gem::Requirement
@@ -91,7 +91,7 @@ dependencies:
91
91
  requirements:
92
92
  - - ~>
93
93
  - !ruby/object:Gem::Version
94
- version: '2.12'
94
+ version: '2.13'
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: simplecov
97
97
  requirement: !ruby/object:Gem::Requirement
@@ -115,7 +115,7 @@ dependencies:
115
115
  requirements:
116
116
  - - ~>
117
117
  - !ruby/object:Gem::Version
118
- version: 3.2.2
118
+ version: 3.2.3
119
119
  type: :development
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
@@ -123,7 +123,7 @@ dependencies:
123
123
  requirements:
124
124
  - - ~>
125
125
  - !ruby/object:Gem::Version
126
- version: 3.2.2
126
+ version: 3.2.3
127
127
  - !ruby/object:Gem::Dependency
128
128
  name: travis-lint
129
129
  requirement: !ruby/object:Gem::Requirement
@@ -147,7 +147,7 @@ dependencies:
147
147
  requirements:
148
148
  - - ~>
149
149
  - !ruby/object:Gem::Version
150
- version: 10.0.3
150
+ version: 10.0.4
151
151
  type: :development
152
152
  prerelease: false
153
153
  version_requirements: !ruby/object:Gem::Requirement
@@ -155,7 +155,7 @@ dependencies:
155
155
  requirements:
156
156
  - - ~>
157
157
  - !ruby/object:Gem::Version
158
- version: 10.0.3
158
+ version: 10.0.4
159
159
  - !ruby/object:Gem::Dependency
160
160
  name: rack-test
161
161
  requirement: !ruby/object:Gem::Requirement
@@ -179,7 +179,7 @@ dependencies:
179
179
  requirements:
180
180
  - - ~>
181
181
  - !ruby/object:Gem::Version
182
- version: 1.5.6
182
+ version: 1.5.9
183
183
  type: :development
184
184
  prerelease: false
185
185
  version_requirements: !ruby/object:Gem::Requirement
@@ -187,7 +187,7 @@ dependencies:
187
187
  requirements:
188
188
  - - ~>
189
189
  - !ruby/object:Gem::Version
190
- version: 1.5.6
190
+ version: 1.5.9
191
191
  - !ruby/object:Gem::Dependency
192
192
  name: wait_until
193
193
  requirement: !ruby/object:Gem::Requirement
@@ -204,6 +204,22 @@ dependencies:
204
204
  - - ~>
205
205
  - !ruby/object:Gem::Version
206
206
  version: 0.0.1
207
+ - !ruby/object:Gem::Dependency
208
+ name: json
209
+ requirement: !ruby/object:Gem::Requirement
210
+ none: false
211
+ requirements:
212
+ - - ~>
213
+ - !ruby/object:Gem::Version
214
+ version: 1.8.0
215
+ type: :development
216
+ prerelease: false
217
+ version_requirements: !ruby/object:Gem::Requirement
218
+ none: false
219
+ requirements:
220
+ - - ~>
221
+ - !ruby/object:Gem::Version
222
+ version: 1.8.0
207
223
  description: fakeweb for a HTTP server, informing it to stub / fake responses.
208
224
  email: matthew.ueckerman@myob.com
209
225
  executables: []
@@ -288,10 +304,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
288
304
  version: '0'
289
305
  segments:
290
306
  - 0
291
- hash: 2072585349946261127
307
+ hash: -1119833046664050459
292
308
  requirements: []
293
309
  rubyforge_project: http_stub
294
- rubygems_version: 1.8.25
310
+ rubygems_version: 1.8.24
295
311
  signing_key:
296
312
  specification_version: 3
297
313
  summary: A HTTP Server replaying configured stub responses.