Skip to content

Commit

Permalink
fix failing tests... heh
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgolick committed May 6, 2009
1 parent 2bbffc1 commit 97e95dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/session_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ def setup
stub(@session).last_response do
response = RestClient::Response.new("", stub!)
stub(response).cookies { {} }
stub(response).code { 200 }
end
@session.trample
end
Expand All @@ -43,6 +44,7 @@ def setup
stub(RestClient).get(anything, anything) do
response = RestClient::Response.new("", stub!)
stub(response).cookies { {"xyz" => "abc"} }
stub(response).code { 200 }
end

@config = Trample::Configuration.new do
Expand Down
3 changes: 3 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def mock_get(url, opts={})
mock(RestClient).get(url, :cookies => opts[:cookies] || {}).times(opts[:times]) do
response = RestClient::Response.new("", stub!)
stub(response).cookies { opts[:return_cookies] || {} }
stub(response).code { 200 }
end
end

Expand All @@ -27,13 +28,15 @@ def mock_post(url, opts={})
:cookies => opts[:cookies] || {}).times(opts[:times]) do
response = RestClient::Response.new("", stub!)
stub(response).cookies { opts[:return_cookies] || {} }
stub(response).code { 200 }
end
end

def stub_get(url, opts = {})
stub(RestClient).get(url, :cookies => opts[:cookies] || {}).times(opts[:times]) do
response = RestClient::Response.new("", stub!)
stub(response).cookies { opts[:return_cookies] || {} }
stub(response).code { 200 }
end
end
end
Expand Down

0 comments on commit 97e95dc

Please sign in to comment.