webmock 0.9.0 → 0.9.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,9 @@
1
1
  #Changelog
2
2
 
3
+ ## 0.9.1
4
+
5
+ * Fixed issue where response status code was not read from raw (curl -is) responses
6
+
3
7
  ## 0.9.0
4
8
 
5
9
  * Matching requests against provided block (by Sergio Gil)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.9.0
1
+ 0.9.1
@@ -76,6 +76,7 @@ module WebMock
76
76
  response.each_header {|name, value| options[:headers][name] = value}
77
77
  options[:headers]['transfer-encoding'] = transfer_encoding if transfer_encoding
78
78
  options[:body] = response.read_body
79
+ options[:status] = response.code.to_i
79
80
  options
80
81
  end
81
82
 
@@ -1,4 +1,4 @@
1
- HTTP/1.1 200 OK
1
+ HTTP/1.1 202 OK
2
2
  Content-Type: text/html; charset=UTF-8
3
3
  Connection: Keep-Alive
4
4
  Date: Sat, 23 Jan 2010 01:01:05 GMT
@@ -78,7 +78,7 @@ describe Response do
78
78
 
79
79
 
80
80
  it "should read status" do
81
- @response.status.should == 200
81
+ @response.status.should == 202
82
82
  end
83
83
 
84
84
  it "should read headers" do
@@ -107,7 +107,7 @@ describe Response do
107
107
  end
108
108
 
109
109
  it "should read status" do
110
- @response.status.should == 200
110
+ @response.status.should == 202
111
111
  end
112
112
 
113
113
  it "should read headers" do
@@ -356,6 +356,10 @@ describe "WebMock", :shared => true do
356
356
  it "should return recorded body" do
357
357
  @response.body.size.should == 438
358
358
  end
359
+
360
+ it "should return recorded status" do
361
+ @response.status.should == "202"
362
+ end
359
363
 
360
364
  it "should ensure file is closed" do
361
365
  @file.should be_closed
@@ -384,6 +388,9 @@ describe "WebMock", :shared => true do
384
388
  @response.body.size.should == 438
385
389
  end
386
390
 
391
+ it "should return recorded status" do
392
+ @response.status.should == "202"
393
+ end
387
394
  end
388
395
 
389
396
  describe "sequences of responses" do
@@ -802,6 +809,14 @@ describe "WebMock", :shared => true do
802
809
  request(:get, "http://www.example.com").should have_been_made.once
803
810
  }.should fail_with("The request GET http://www.example.com/ was expected to execute 1 time but it executed 0 times")
804
811
  end
812
+
813
+ it "should be order insensitive" do
814
+ stub_request(:post, "http://www.example.com")
815
+ http_request(:post, "http://www.example.com/", :body => "def")
816
+ http_request(:post, "http://www.example.com/", :body => "abc")
817
+ WebMock.should have_requested(:post, "www.example.com").with(:body => "abc")
818
+ WebMock.should have_requested(:post, "www.example.com").with(:body => "def")
819
+ end
805
820
 
806
821
  end
807
822
 
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{webmock}
8
- s.version = "0.9.0"
8
+ s.version = "0.9.1"
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-01-31}
12
+ s.date = %q{2010-02-02}
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,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webmock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bartosz Blimke
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-31 00:00:00 +00:00
12
+ date: 2010-02-02 00:00:00 +00:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency