webmock 0.9.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +4 -0
- data/VERSION +1 -1
- data/lib/webmock/response.rb +1 -0
- data/spec/example_curl_output.txt +1 -1
- data/spec/response_spec.rb +2 -2
- data/spec/webmock_spec.rb +15 -0
- data/webmock.gemspec +2 -2
- metadata +2 -2
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.1
|
data/lib/webmock/response.rb
CHANGED
@@ -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
|
|
data/spec/response_spec.rb
CHANGED
@@ -78,7 +78,7 @@ describe Response do
|
|
78
78
|
|
79
79
|
|
80
80
|
it "should read status" do
|
81
|
-
@response.status.should ==
|
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 ==
|
110
|
+
@response.status.should == 202
|
111
111
|
end
|
112
112
|
|
113
113
|
it "should read headers" do
|
data/spec/webmock_spec.rb
CHANGED
@@ -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
|
|
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 = "0.9.
|
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-
|
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.
|
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-
|
12
|
+
date: 2010-02-02 00:00:00 +00:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|