webmock 1.7.0 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.7.1
4
+
5
+ * Redefined `const_defined?` on the replaced `Net::HTTP` so that it returns true if constant is defined on the original `Net::HTTP`. This fixes problems with `"Net::HTTP::Get".constantize`.
6
+
7
+ Thanks to [Cássio Marques](https://github.com/cassiomarques) for reporting the issue and to [Myron Marston](https://github.com/myronmarston) for help with the solution.
8
+
3
9
  ## 1.7.0
4
10
 
5
11
  * Fixed Net::HTTP adapter to not break normal Net::HTTP behaviour when network connections are allowed. This fixes **selenium-webdriver compatibility**!!!
@@ -74,6 +74,12 @@ module Net #:nodoc: all
74
74
  end
75
75
  alias_method :socket_type_without_webmock, :socket_type
76
76
  alias_method :socket_type, :socket_type_with_webmock
77
+
78
+ if ::RUBY_VERSION =~ /1.8/
79
+ def const_defined?(name)
80
+ super || self.superclass.const_defined?(name)
81
+ end
82
+ end
77
83
  end
78
84
 
79
85
  def request_with_webmock(request, body = nil, &block)
@@ -1,3 +1,3 @@
1
1
  module WebMock
2
- VERSION = '1.7.0' unless defined?(::WebMock::VERSION)
2
+ VERSION = '1.7.1' unless defined?(::WebMock::VERSION)
3
3
  end
@@ -11,6 +11,10 @@ describe "Webmock with Net:HTTP" do
11
11
 
12
12
  let(:port){ WebMockServer.instance.port }
13
13
 
14
+ it "should still have const Get defined on replaced Net::HTTP" do
15
+ Object.const_get("Net").const_get("HTTP").const_defined?("Get").should be_true
16
+ end
17
+
14
18
  it "should work with block provided" do
15
19
  stub_http_request(:get, "www.example.com").to_return(:body => "abc"*100000)
16
20
  Net::HTTP.start("www.example.com") { |query| query.get("/") }.body.should == "abc"*100000
metadata CHANGED
@@ -1,137 +1,200 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: webmock
3
- version: !ruby/object:Gem::Version
4
- version: 1.7.0
3
+ version: !ruby/object:Gem::Version
4
+ hash: 9
5
5
  prerelease:
6
+ segments:
7
+ - 1
8
+ - 7
9
+ - 1
10
+ version: 1.7.1
6
11
  platform: ruby
7
- authors:
12
+ authors:
8
13
  - Bartosz Blimke
9
14
  autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
- date: 2011-08-15 00:00:00.000000000Z
13
- dependencies:
14
- - !ruby/object:Gem::Dependency
17
+
18
+ date: 2011-08-15 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
15
21
  name: addressable
16
- requirement: &2153406180 !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
17
24
  none: false
18
- requirements:
25
+ requirements:
19
26
  - - ~>
20
- - !ruby/object:Gem::Version
21
- version: '2.2'
22
- - - ! '>'
23
- - !ruby/object:Gem::Version
27
+ - !ruby/object:Gem::Version
28
+ hash: 7
29
+ segments:
30
+ - 2
31
+ - 2
32
+ version: "2.2"
33
+ - - ">"
34
+ - !ruby/object:Gem::Version
35
+ hash: 13
36
+ segments:
37
+ - 2
38
+ - 2
39
+ - 5
24
40
  version: 2.2.5
25
41
  type: :runtime
26
- prerelease: false
27
- version_requirements: *2153406180
28
- - !ruby/object:Gem::Dependency
42
+ version_requirements: *id001
43
+ - !ruby/object:Gem::Dependency
29
44
  name: crack
30
- requirement: &2153404320 !ruby/object:Gem::Requirement
45
+ prerelease: false
46
+ requirement: &id002 !ruby/object:Gem::Requirement
31
47
  none: false
32
- requirements:
33
- - - ! '>='
34
- - !ruby/object:Gem::Version
48
+ requirements:
49
+ - - ">="
50
+ - !ruby/object:Gem::Version
51
+ hash: 21
52
+ segments:
53
+ - 0
54
+ - 1
55
+ - 7
35
56
  version: 0.1.7
36
57
  type: :runtime
37
- prerelease: false
38
- version_requirements: *2153404320
39
- - !ruby/object:Gem::Dependency
58
+ version_requirements: *id002
59
+ - !ruby/object:Gem::Dependency
40
60
  name: rspec
41
- requirement: &2153403860 !ruby/object:Gem::Requirement
61
+ prerelease: false
62
+ requirement: &id003 !ruby/object:Gem::Requirement
42
63
  none: false
43
- requirements:
44
- - - ! '>='
45
- - !ruby/object:Gem::Version
64
+ requirements:
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ hash: 15
68
+ segments:
69
+ - 2
70
+ - 0
71
+ - 0
46
72
  version: 2.0.0
47
73
  type: :development
48
- prerelease: false
49
- version_requirements: *2153403860
50
- - !ruby/object:Gem::Dependency
74
+ version_requirements: *id003
75
+ - !ruby/object:Gem::Dependency
51
76
  name: httpclient
52
- requirement: &2153403160 !ruby/object:Gem::Requirement
77
+ prerelease: false
78
+ requirement: &id004 !ruby/object:Gem::Requirement
53
79
  none: false
54
- requirements:
55
- - - ! '>='
56
- - !ruby/object:Gem::Version
80
+ requirements:
81
+ - - ">="
82
+ - !ruby/object:Gem::Version
83
+ hash: 119
84
+ segments:
85
+ - 2
86
+ - 1
87
+ - 5
88
+ - 2
57
89
  version: 2.1.5.2
58
90
  type: :development
59
- prerelease: false
60
- version_requirements: *2153403160
61
- - !ruby/object:Gem::Dependency
91
+ version_requirements: *id004
92
+ - !ruby/object:Gem::Dependency
62
93
  name: patron
63
- requirement: &2153402700 !ruby/object:Gem::Requirement
94
+ prerelease: false
95
+ requirement: &id005 !ruby/object:Gem::Requirement
64
96
  none: false
65
- requirements:
66
- - - ! '>='
67
- - !ruby/object:Gem::Version
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ hash: 29
101
+ segments:
102
+ - 0
103
+ - 4
104
+ - 9
68
105
  version: 0.4.9
69
106
  type: :development
70
- prerelease: false
71
- version_requirements: *2153402700
72
- - !ruby/object:Gem::Dependency
107
+ version_requirements: *id005
108
+ - !ruby/object:Gem::Dependency
73
109
  name: em-http-request
74
- requirement: &2153402220 !ruby/object:Gem::Requirement
110
+ prerelease: false
111
+ requirement: &id006 !ruby/object:Gem::Requirement
75
112
  none: false
76
- requirements:
77
- - - ! '>='
78
- - !ruby/object:Gem::Version
113
+ requirements:
114
+ - - ">="
115
+ - !ruby/object:Gem::Version
116
+ hash: 11
117
+ segments:
118
+ - 0
119
+ - 2
120
+ - 14
79
121
  version: 0.2.14
80
122
  type: :development
81
- prerelease: false
82
- version_requirements: *2153402220
83
- - !ruby/object:Gem::Dependency
123
+ version_requirements: *id006
124
+ - !ruby/object:Gem::Dependency
84
125
  name: curb
85
- requirement: &2153401700 !ruby/object:Gem::Requirement
126
+ prerelease: false
127
+ requirement: &id007 !ruby/object:Gem::Requirement
86
128
  none: false
87
- requirements:
88
- - - ! '>='
89
- - !ruby/object:Gem::Version
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ hash: 19
133
+ segments:
134
+ - 0
135
+ - 7
136
+ - 8
90
137
  version: 0.7.8
91
138
  type: :development
92
- prerelease: false
93
- version_requirements: *2153401700
94
- - !ruby/object:Gem::Dependency
139
+ version_requirements: *id007
140
+ - !ruby/object:Gem::Dependency
95
141
  name: typhoeus
96
- requirement: &2153401220 !ruby/object:Gem::Requirement
142
+ prerelease: false
143
+ requirement: &id008 !ruby/object:Gem::Requirement
97
144
  none: false
98
- requirements:
99
- - - ! '>='
100
- - !ruby/object:Gem::Version
145
+ requirements:
146
+ - - ">="
147
+ - !ruby/object:Gem::Version
148
+ hash: 31
149
+ segments:
150
+ - 0
151
+ - 2
152
+ - 4
101
153
  version: 0.2.4
102
154
  type: :development
103
- prerelease: false
104
- version_requirements: *2153401220
105
- - !ruby/object:Gem::Dependency
155
+ version_requirements: *id008
156
+ - !ruby/object:Gem::Dependency
106
157
  name: minitest
107
- requirement: &2153400760 !ruby/object:Gem::Requirement
158
+ prerelease: false
159
+ requirement: &id009 !ruby/object:Gem::Requirement
108
160
  none: false
109
- requirements:
110
- - - ! '>='
111
- - !ruby/object:Gem::Version
161
+ requirements:
162
+ - - ">="
163
+ - !ruby/object:Gem::Version
164
+ hash: 3
165
+ segments:
166
+ - 2
167
+ - 2
168
+ - 2
112
169
  version: 2.2.2
113
170
  type: :development
114
- prerelease: false
115
- version_requirements: *2153400760
116
- - !ruby/object:Gem::Dependency
171
+ version_requirements: *id009
172
+ - !ruby/object:Gem::Dependency
117
173
  name: rdoc
118
- requirement: &2153400200 !ruby/object:Gem::Requirement
174
+ prerelease: false
175
+ requirement: &id010 !ruby/object:Gem::Requirement
119
176
  none: false
120
- requirements:
121
- - - ! '>'
122
- - !ruby/object:Gem::Version
177
+ requirements:
178
+ - - ">"
179
+ - !ruby/object:Gem::Version
180
+ hash: 19
181
+ segments:
182
+ - 3
183
+ - 5
184
+ - 0
123
185
  version: 3.5.0
124
186
  type: :development
125
- prerelease: false
126
- version_requirements: *2153400200
127
- description: WebMock allows stubbing HTTP requests and setting expectations on HTTP
128
- requests.
129
- email:
187
+ version_requirements: *id010
188
+ description: WebMock allows stubbing HTTP requests and setting expectations on HTTP requests.
189
+ email:
130
190
  - bartosz.blimke@gmail.com
131
191
  executables: []
192
+
132
193
  extensions: []
194
+
133
195
  extra_rdoc_files: []
134
- files:
196
+
197
+ files:
135
198
  - .gemtest
136
199
  - .gitignore
137
200
  - .rvmrc
@@ -243,29 +306,38 @@ files:
243
306
  - webmock.gemspec
244
307
  homepage: http://github.com/bblimke/webmock
245
308
  licenses: []
309
+
246
310
  post_install_message:
247
311
  rdoc_options: []
248
- require_paths:
312
+
313
+ require_paths:
249
314
  - lib
250
- required_ruby_version: !ruby/object:Gem::Requirement
315
+ required_ruby_version: !ruby/object:Gem::Requirement
251
316
  none: false
252
- requirements:
253
- - - ! '>='
254
- - !ruby/object:Gem::Version
255
- version: '0'
256
- required_rubygems_version: !ruby/object:Gem::Requirement
317
+ requirements:
318
+ - - ">="
319
+ - !ruby/object:Gem::Version
320
+ hash: 3
321
+ segments:
322
+ - 0
323
+ version: "0"
324
+ required_rubygems_version: !ruby/object:Gem::Requirement
257
325
  none: false
258
- requirements:
259
- - - ! '>='
260
- - !ruby/object:Gem::Version
261
- version: '0'
326
+ requirements:
327
+ - - ">="
328
+ - !ruby/object:Gem::Version
329
+ hash: 3
330
+ segments:
331
+ - 0
332
+ version: "0"
262
333
  requirements: []
334
+
263
335
  rubyforge_project: webmock
264
336
  rubygems_version: 1.8.6
265
337
  signing_key:
266
338
  specification_version: 3
267
339
  summary: Library for stubbing HTTP requests in Ruby.
268
- test_files:
340
+ test_files:
269
341
  - spec/curb_spec.rb
270
342
  - spec/curb_spec_helper.rb
271
343
  - spec/em_http_request_spec.rb