webmock 1.3.3 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,10 @@
1
1
  #Changelog
2
2
 
3
+ ## 1.3.4
4
+
5
+ * Fixed Net::HTTP adapter to handle cases where a block with `read_body` call is passed to `request`.
6
+ This fixes compatibility with `open-uri`. Thanks to Mark Evans for reporting the issue.
7
+
3
8
  ## 1.3.3
4
9
 
5
10
  * Fixed handling of multiple values for the same response header for Net::HTTP. Thanks to Myron Marston for reporting the issue.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.3
1
+ 1.3.4
@@ -71,8 +71,8 @@ module Net #:nodoc: all
71
71
  webmock_response = build_webmock_response(response)
72
72
  WebMock::CallbackRegistry.invoke_callbacks(
73
73
  {:lib => :net_http, :real_request => true}, request_signature, webmock_response)
74
- response.extend WebMock::Net::HTTPResponse
75
74
  end
75
+ response.extend WebMock::Net::HTTPResponse
76
76
  yield response if block_given?
77
77
  response
78
78
  else
@@ -59,6 +59,20 @@ describe "Webmock with Net:HTTP" do
59
59
  http.request(req, StringIO.new("my_params"))
60
60
  }.body.should =~ /Example Web Page/
61
61
  end
62
+
63
+ it "should handle requests with block passed to read_body" do
64
+ body = ""
65
+ WebMock.allow_net_connect!
66
+ req = Net::HTTP::Get.new("/")
67
+ Net::HTTP.start("www.example.com") do |http|
68
+ http.request(req) do |res|
69
+ res.read_body do |str|
70
+ body << str
71
+ end
72
+ end
73
+ end
74
+ body.should =~ /Example Web Page/
75
+ end
62
76
 
63
77
  describe 'after_request callback support' do
64
78
  let(:expected_body_regex) { /You have reached this web page by typing.*example\.com/ }
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{webmock}
8
- s.version = "1.3.3"
8
+ s.version = "1.3.4"
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-08-03}
12
+ s.date = %q{2010-08-10}
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 = [
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webmock
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 3
9
- - 3
10
- version: 1.3.3
9
+ - 4
10
+ version: 1.3.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Bartosz Blimke
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-03 00:00:00 +01:00
18
+ date: 2010-08-10 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency