THRIFT-1645: Replace Object#tee with more conventional Object#tap in specs
Client: rb
Patch: Nathan Beyer
The spec_helper.rb defines an Object#tee method, which is functionally equivalent to Object#tap. Object#tap was added to Ruby 1.9 and to 1.8.7.
git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1392509 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/rb/spec/http_client_spec.rb b/lib/rb/spec/http_client_spec.rb
index b596279..0890a8b 100644
--- a/lib/rb/spec/http_client_spec.rb
+++ b/lib/rb/spec/http_client_spec.rb
@@ -36,10 +36,10 @@
@client.write "a test"
@client.write " frame"
Net::HTTP.should_receive(:new).with("my.domain.com", 80).and_return do
- mock("Net::HTTP").tee do |http|
+ mock("Net::HTTP").tap do |http|
http.should_receive(:use_ssl=).with(false)
http.should_receive(:post).with("/path/to/service?param=value", "a test frame", {"Content-Type"=>"application/x-thrift"}).and_return do
- mock("Net::HTTPOK").tee do |response|
+ mock("Net::HTTPOK").tap do |response|
response.should_receive(:body).and_return "data"
end
end
@@ -56,10 +56,10 @@
@client.add_headers(custom_headers)
Net::HTTP.should_receive(:new).with("my.domain.com", 80).and_return do
- mock("Net::HTTP").tee do |http|
+ mock("Net::HTTP").tap do |http|
http.should_receive(:use_ssl=).with(false)
http.should_receive(:post).with("/path/to/service?param=value", "test", headers).and_return do
- mock("Net::HTTPOK").tee do |response|
+ mock("Net::HTTPOK").tap do |response|
response.should_receive(:body).and_return "data"
end
end