Skip to content

Commit

Permalink
fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
brianmario committed Jan 2, 2010
1 parent 6849f58 commit 41e1894
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 20 deletions.
7 changes: 2 additions & 5 deletions spec/http/http_delete_spec.rb
Expand Up @@ -40,11 +40,6 @@ def prepare_mock_request_dump(format=:raw)
@uri = 'file://'+File.expand_path(File.dirname(__FILE__) + "/fixtures/http/http.#{format}.dump")
TCPSocket.should_receive(:new).and_return(@request)
@request.should_receive(:write)
@uri.should_receive(:host).at_least(2).times
@uri.should_receive(:port)
@uri.should_receive(:path)
@uri.should_receive(:query)
@uri.should_receive(:userinfo)
end

it "should parse a raw response" do
Expand All @@ -54,6 +49,8 @@ def prepare_mock_request_dump(format=:raw)

it "should parse a raw response using instance method" do
prepare_mock_request_dump :raw
@uri.should_receive(:host)
@uri.should_receive(:port)
stream = Yajl::HttpStream.new
@template_hash.should == stream.delete(@uri)
end
Expand Down
9 changes: 4 additions & 5 deletions spec/http/http_get_spec.rb
Expand Up @@ -41,11 +41,6 @@ def prepare_mock_request_dump(format=:raw)
@uri = 'file://'+File.expand_path(File.dirname(__FILE__) + "/fixtures/http/http.#{format}.dump")
TCPSocket.should_receive(:new).and_return(@request)
@request.should_receive(:write)
@uri.should_receive(:host).at_least(2).times
@uri.should_receive(:port)
@uri.should_receive(:path)
@uri.should_receive(:query)
@uri.should_receive(:userinfo)
end

it "should parse a raw response" do
Expand All @@ -60,12 +55,16 @@ def prepare_mock_request_dump(format=:raw)

it "should parse a raw response using instance method" do
prepare_mock_request_dump :raw
@uri.should_receive(:host)
@uri.should_receive(:port)
stream = Yajl::HttpStream.new
@template_hash.should == stream.get(@uri)
end

it "should parse a chunked response using instance method" do
prepare_mock_request_dump :chunked
@uri.should_receive(:host)
@uri.should_receive(:port)
stream = Yajl::HttpStream.new
stream.get(@uri) do |obj|
obj.should eql(@chunked_body)
Expand Down
7 changes: 2 additions & 5 deletions spec/http/http_post_spec.rb
Expand Up @@ -43,11 +43,6 @@ def prepare_mock_request_dump(format=:raw)
@uri = 'file://'+File.expand_path(File.dirname(__FILE__) + "/fixtures/http/http.#{format}.dump")
TCPSocket.should_receive(:new).and_return(@request)
@request.should_receive(:write)
@uri.should_receive(:host).at_least(2).times
@uri.should_receive(:port)
@uri.should_receive(:path)
@uri.should_receive(:query)
@uri.should_receive(:userinfo)
end

it "should parse a raw response" do
Expand All @@ -57,6 +52,8 @@ def prepare_mock_request_dump(format=:raw)

it "should parse a raw response using instance method" do
prepare_mock_request_dump :raw
@uri.should_receive(:host)
@uri.should_receive(:port)
stream = Yajl::HttpStream.new
@template_hash.should == stream.post(@uri, @body)
end
Expand Down
7 changes: 2 additions & 5 deletions spec/http/http_put_spec.rb
Expand Up @@ -42,11 +42,6 @@ def prepare_mock_request_dump(format=:raw)
@uri = 'file://'+File.expand_path(File.dirname(__FILE__) + "/fixtures/http/http.#{format}.dump")
TCPSocket.should_receive(:new).and_return(@request)
@request.should_receive(:write)
@uri.should_receive(:host).at_least(2).times
@uri.should_receive(:port)
@uri.should_receive(:path)
@uri.should_receive(:query)
@uri.should_receive(:userinfo)
end

it "should parse a raw response" do
Expand All @@ -56,6 +51,8 @@ def prepare_mock_request_dump(format=:raw)

it "should parse a raw response using instance method" do
prepare_mock_request_dump :raw
@uri.should_receive(:host)
@uri.should_receive(:port)
stream = Yajl::HttpStream.new
@template_hash.should == stream.put(@uri, @body)
end
Expand Down

0 comments on commit 41e1894

Please sign in to comment.