webmock 1.3.5 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +23 -0
- data/README.md +17 -20
- data/Rakefile +4 -3
- data/VERSION +1 -1
- data/lib/webmock.rb +5 -0
- data/lib/webmock/adapters/rspec.rb +12 -9
- data/lib/webmock/adapters/test_unit.rb +1 -6
- data/lib/webmock/api.rb +32 -0
- data/lib/webmock/assertion_failure.rb +13 -0
- data/lib/webmock/deprecation.rb +9 -0
- data/lib/webmock/http_lib_adapters/curb.rb +260 -0
- data/lib/webmock/http_lib_adapters/em_http_request.rb +2 -2
- data/lib/webmock/http_lib_adapters/httpclient.rb +4 -3
- data/lib/webmock/http_lib_adapters/net_http.rb +2 -2
- data/lib/webmock/http_lib_adapters/net_http_response.rb +9 -27
- data/lib/webmock/http_lib_adapters/patron.rb +2 -2
- data/lib/webmock/util/uri.rb +5 -0
- data/lib/webmock/webmock.rb +47 -41
- data/spec/curb_spec.rb +173 -0
- data/spec/curb_spec_helper.rb +137 -0
- data/spec/request_execution_verifier_spec.rb +9 -9
- data/spec/request_pattern_spec.rb +115 -115
- data/spec/request_registry_spec.rb +44 -42
- data/spec/request_signature_spec.rb +6 -6
- data/spec/request_stub_spec.rb +5 -5
- data/spec/response_spec.rb +33 -33
- data/spec/spec_helper.rb +2 -3
- data/spec/util/hash_counter_spec.rb +4 -4
- data/spec/util/headers_spec.rb +4 -4
- data/spec/webmock_spec.rb +67 -54
- data/test/test_helper.rb +2 -2
- data/webmock.gemspec +25 -14
- metadata +34 -29
data/test/test_helper.rb
CHANGED
@@ -7,8 +7,8 @@ require 'webmock/test_unit'
|
|
7
7
|
require 'test/unit'
|
8
8
|
|
9
9
|
class Test::Unit::TestCase
|
10
|
-
include WebMock
|
11
|
-
|
10
|
+
include WebMock::API
|
11
|
+
AssertionFailedError = Test::Unit::AssertionFailedError rescue MiniTest::Assertion
|
12
12
|
def assert_fail(message, &block)
|
13
13
|
e = assert_raise(AssertionFailedError, &block)
|
14
14
|
assert_equal(message, e.message)
|
data/webmock.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{webmock}
|
8
|
-
s.version = "1.
|
8
|
+
s.version = "1.4.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Bartosz Blimke"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-10-13}
|
13
13
|
s.description = %q{WebMock allows stubbing HTTP requests and setting expectations on HTTP requests.}
|
14
14
|
s.email = %q{bartosz.blimke@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -29,9 +29,13 @@ Gem::Specification.new do |s|
|
|
29
29
|
"lib/webmock/adapters/rspec/request_pattern_matcher.rb",
|
30
30
|
"lib/webmock/adapters/rspec/webmock_matcher.rb",
|
31
31
|
"lib/webmock/adapters/test_unit.rb",
|
32
|
+
"lib/webmock/api.rb",
|
33
|
+
"lib/webmock/assertion_failure.rb",
|
32
34
|
"lib/webmock/callback_registry.rb",
|
33
35
|
"lib/webmock/config.rb",
|
36
|
+
"lib/webmock/deprecation.rb",
|
34
37
|
"lib/webmock/errors.rb",
|
38
|
+
"lib/webmock/http_lib_adapters/curb.rb",
|
35
39
|
"lib/webmock/http_lib_adapters/em_http_request.rb",
|
36
40
|
"lib/webmock/http_lib_adapters/httpclient.rb",
|
37
41
|
"lib/webmock/http_lib_adapters/net_http.rb",
|
@@ -50,6 +54,8 @@ Gem::Specification.new do |s|
|
|
50
54
|
"lib/webmock/util/headers.rb",
|
51
55
|
"lib/webmock/util/uri.rb",
|
52
56
|
"lib/webmock/webmock.rb",
|
57
|
+
"spec/curb_spec.rb",
|
58
|
+
"spec/curb_spec_helper.rb",
|
53
59
|
"spec/em_http_request_spec.rb",
|
54
60
|
"spec/em_http_request_spec_helper.rb",
|
55
61
|
"spec/example_curl_output.txt",
|
@@ -89,10 +95,12 @@ Gem::Specification.new do |s|
|
|
89
95
|
s.homepage = %q{http://github.com/bblimke/webmock}
|
90
96
|
s.rdoc_options = ["--charset=UTF-8"]
|
91
97
|
s.require_paths = ["lib"]
|
92
|
-
s.rubygems_version = %q{1.3.
|
98
|
+
s.rubygems_version = %q{1.3.6}
|
93
99
|
s.summary = %q{Library for stubbing HTTP requests in Ruby.}
|
94
100
|
s.test_files = [
|
95
|
-
"spec/
|
101
|
+
"spec/curb_spec.rb",
|
102
|
+
"spec/curb_spec_helper.rb",
|
103
|
+
"spec/em_http_request_spec.rb",
|
96
104
|
"spec/em_http_request_spec_helper.rb",
|
97
105
|
"spec/httpclient_spec.rb",
|
98
106
|
"spec/httpclient_spec_helper.rb",
|
@@ -126,28 +134,31 @@ Gem::Specification.new do |s|
|
|
126
134
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
127
135
|
s.specification_version = 3
|
128
136
|
|
129
|
-
if Gem::Version.new(Gem::
|
130
|
-
s.add_runtime_dependency(%q<addressable>, [">= 2.
|
137
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
138
|
+
s.add_runtime_dependency(%q<addressable>, [">= 2.2.2"])
|
131
139
|
s.add_runtime_dependency(%q<crack>, [">= 0.1.7"])
|
132
140
|
s.add_development_dependency(%q<rspec>, [">= 1.2.9"])
|
133
141
|
s.add_development_dependency(%q<httpclient>, [">= 2.1.5.2"])
|
134
|
-
s.add_development_dependency(%q<patron>, [">= 0.4.
|
135
|
-
s.add_development_dependency(%q<em-http-request>, [">= 0.2.
|
142
|
+
s.add_development_dependency(%q<patron>, [">= 0.4.9"])
|
143
|
+
s.add_development_dependency(%q<em-http-request>, [">= 0.2.14"])
|
144
|
+
s.add_development_dependency(%q<curb>, [">= 0.7.8"])
|
136
145
|
else
|
137
|
-
s.add_dependency(%q<addressable>, [">= 2.
|
146
|
+
s.add_dependency(%q<addressable>, [">= 2.2.2"])
|
138
147
|
s.add_dependency(%q<crack>, [">= 0.1.7"])
|
139
148
|
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
140
149
|
s.add_dependency(%q<httpclient>, [">= 2.1.5.2"])
|
141
|
-
s.add_dependency(%q<patron>, [">= 0.4.
|
142
|
-
s.add_dependency(%q<em-http-request>, [">= 0.2.
|
150
|
+
s.add_dependency(%q<patron>, [">= 0.4.9"])
|
151
|
+
s.add_dependency(%q<em-http-request>, [">= 0.2.14"])
|
152
|
+
s.add_dependency(%q<curb>, [">= 0.7.8"])
|
143
153
|
end
|
144
154
|
else
|
145
|
-
s.add_dependency(%q<addressable>, [">= 2.
|
155
|
+
s.add_dependency(%q<addressable>, [">= 2.2.2"])
|
146
156
|
s.add_dependency(%q<crack>, [">= 0.1.7"])
|
147
157
|
s.add_dependency(%q<rspec>, [">= 1.2.9"])
|
148
158
|
s.add_dependency(%q<httpclient>, [">= 2.1.5.2"])
|
149
|
-
s.add_dependency(%q<patron>, [">= 0.4.
|
150
|
-
s.add_dependency(%q<em-http-request>, [">= 0.2.
|
159
|
+
s.add_dependency(%q<patron>, [">= 0.4.9"])
|
160
|
+
s.add_dependency(%q<em-http-request>, [">= 0.2.14"])
|
161
|
+
s.add_dependency(%q<curb>, [">= 0.7.8"])
|
151
162
|
end
|
152
163
|
end
|
153
164
|
|
metadata
CHANGED
@@ -1,13 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: webmock
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash: 17
|
5
4
|
prerelease: false
|
6
5
|
segments:
|
7
6
|
- 1
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 1.
|
7
|
+
- 4
|
8
|
+
- 0
|
9
|
+
version: 1.4.0
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
12
|
- Bartosz Blimke
|
@@ -15,34 +14,30 @@ autorequire:
|
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2010-
|
17
|
+
date: 2010-10-13 00:00:00 +01:00
|
19
18
|
default_executable:
|
20
19
|
dependencies:
|
21
20
|
- !ruby/object:Gem::Dependency
|
22
21
|
name: addressable
|
23
22
|
prerelease: false
|
24
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
24
|
requirements:
|
27
25
|
- - ">="
|
28
26
|
- !ruby/object:Gem::Version
|
29
|
-
hash: 9
|
30
27
|
segments:
|
31
28
|
- 2
|
32
|
-
-
|
33
|
-
-
|
34
|
-
version: 2.
|
29
|
+
- 2
|
30
|
+
- 2
|
31
|
+
version: 2.2.2
|
35
32
|
type: :runtime
|
36
33
|
version_requirements: *id001
|
37
34
|
- !ruby/object:Gem::Dependency
|
38
35
|
name: crack
|
39
36
|
prerelease: false
|
40
37
|
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
38
|
requirements:
|
43
39
|
- - ">="
|
44
40
|
- !ruby/object:Gem::Version
|
45
|
-
hash: 21
|
46
41
|
segments:
|
47
42
|
- 0
|
48
43
|
- 1
|
@@ -54,11 +49,9 @@ dependencies:
|
|
54
49
|
name: rspec
|
55
50
|
prerelease: false
|
56
51
|
requirement: &id003 !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
52
|
requirements:
|
59
53
|
- - ">="
|
60
54
|
- !ruby/object:Gem::Version
|
61
|
-
hash: 13
|
62
55
|
segments:
|
63
56
|
- 1
|
64
57
|
- 2
|
@@ -70,11 +63,9 @@ dependencies:
|
|
70
63
|
name: httpclient
|
71
64
|
prerelease: false
|
72
65
|
requirement: &id004 !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
66
|
requirements:
|
75
67
|
- - ">="
|
76
68
|
- !ruby/object:Gem::Version
|
77
|
-
hash: 119
|
78
69
|
segments:
|
79
70
|
- 2
|
80
71
|
- 1
|
@@ -87,34 +78,44 @@ dependencies:
|
|
87
78
|
name: patron
|
88
79
|
prerelease: false
|
89
80
|
requirement: &id005 !ruby/object:Gem::Requirement
|
90
|
-
none: false
|
91
81
|
requirements:
|
92
82
|
- - ">="
|
93
83
|
- !ruby/object:Gem::Version
|
94
|
-
hash: 5
|
95
84
|
segments:
|
96
85
|
- 0
|
97
86
|
- 4
|
98
|
-
-
|
99
|
-
version: 0.4.
|
87
|
+
- 9
|
88
|
+
version: 0.4.9
|
100
89
|
type: :development
|
101
90
|
version_requirements: *id005
|
102
91
|
- !ruby/object:Gem::Dependency
|
103
92
|
name: em-http-request
|
104
93
|
prerelease: false
|
105
94
|
requirement: &id006 !ruby/object:Gem::Requirement
|
106
|
-
none: false
|
107
95
|
requirements:
|
108
96
|
- - ">="
|
109
97
|
- !ruby/object:Gem::Version
|
110
|
-
hash: 25
|
111
98
|
segments:
|
112
99
|
- 0
|
113
100
|
- 2
|
114
|
-
-
|
115
|
-
version: 0.2.
|
101
|
+
- 14
|
102
|
+
version: 0.2.14
|
116
103
|
type: :development
|
117
104
|
version_requirements: *id006
|
105
|
+
- !ruby/object:Gem::Dependency
|
106
|
+
name: curb
|
107
|
+
prerelease: false
|
108
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
109
|
+
requirements:
|
110
|
+
- - ">="
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
segments:
|
113
|
+
- 0
|
114
|
+
- 7
|
115
|
+
- 8
|
116
|
+
version: 0.7.8
|
117
|
+
type: :development
|
118
|
+
version_requirements: *id007
|
118
119
|
description: WebMock allows stubbing HTTP requests and setting expectations on HTTP requests.
|
119
120
|
email: bartosz.blimke@gmail.com
|
120
121
|
executables: []
|
@@ -137,9 +138,13 @@ files:
|
|
137
138
|
- lib/webmock/adapters/rspec/request_pattern_matcher.rb
|
138
139
|
- lib/webmock/adapters/rspec/webmock_matcher.rb
|
139
140
|
- lib/webmock/adapters/test_unit.rb
|
141
|
+
- lib/webmock/api.rb
|
142
|
+
- lib/webmock/assertion_failure.rb
|
140
143
|
- lib/webmock/callback_registry.rb
|
141
144
|
- lib/webmock/config.rb
|
145
|
+
- lib/webmock/deprecation.rb
|
142
146
|
- lib/webmock/errors.rb
|
147
|
+
- lib/webmock/http_lib_adapters/curb.rb
|
143
148
|
- lib/webmock/http_lib_adapters/em_http_request.rb
|
144
149
|
- lib/webmock/http_lib_adapters/httpclient.rb
|
145
150
|
- lib/webmock/http_lib_adapters/net_http.rb
|
@@ -158,6 +163,8 @@ files:
|
|
158
163
|
- lib/webmock/util/headers.rb
|
159
164
|
- lib/webmock/util/uri.rb
|
160
165
|
- lib/webmock/webmock.rb
|
166
|
+
- spec/curb_spec.rb
|
167
|
+
- spec/curb_spec_helper.rb
|
161
168
|
- spec/em_http_request_spec.rb
|
162
169
|
- spec/em_http_request_spec_helper.rb
|
163
170
|
- spec/example_curl_output.txt
|
@@ -203,31 +210,29 @@ rdoc_options:
|
|
203
210
|
require_paths:
|
204
211
|
- lib
|
205
212
|
required_ruby_version: !ruby/object:Gem::Requirement
|
206
|
-
none: false
|
207
213
|
requirements:
|
208
214
|
- - ">="
|
209
215
|
- !ruby/object:Gem::Version
|
210
|
-
hash: 3
|
211
216
|
segments:
|
212
217
|
- 0
|
213
218
|
version: "0"
|
214
219
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
215
|
-
none: false
|
216
220
|
requirements:
|
217
221
|
- - ">="
|
218
222
|
- !ruby/object:Gem::Version
|
219
|
-
hash: 3
|
220
223
|
segments:
|
221
224
|
- 0
|
222
225
|
version: "0"
|
223
226
|
requirements: []
|
224
227
|
|
225
228
|
rubyforge_project:
|
226
|
-
rubygems_version: 1.3.
|
229
|
+
rubygems_version: 1.3.6
|
227
230
|
signing_key:
|
228
231
|
specification_version: 3
|
229
232
|
summary: Library for stubbing HTTP requests in Ruby.
|
230
233
|
test_files:
|
234
|
+
- spec/curb_spec.rb
|
235
|
+
- spec/curb_spec_helper.rb
|
231
236
|
- spec/em_http_request_spec.rb
|
232
237
|
- spec/em_http_request_spec_helper.rb
|
233
238
|
- spec/httpclient_spec.rb
|