forked from typhoeus/typhoeus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored the tests to not use the event machine delay server which …
…was behaving oddly
- Loading branch information
Showing
12 changed files
with
725 additions
and
927 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,37 @@ | ||
require 'rubygems' | ||
require 'sinatra' | ||
require 'json' | ||
|
||
@@fail_count = 0 | ||
get '/fail/:number' do | ||
if @@fail_count >= params[:number].to_i | ||
"ok" | ||
else | ||
@@fail_count += 1 | ||
error 500, "oh noes!" | ||
end | ||
end | ||
|
||
get '/fail_forever' do | ||
error 500, "oh noes!" | ||
end | ||
|
||
get '/**' do | ||
sleep params["delay"].to_i if params.has_key?("delay") | ||
params.inspect | ||
request.env.merge!(:body => request.body.read).to_json | ||
end | ||
|
||
put '/**' do | ||
puts request.inspect | ||
puts "**#{request.body.read}**" | ||
request.env.merge!(:body => request.body.read).to_json | ||
end | ||
|
||
post '/**' do | ||
puts request.inspect | ||
puts "**#{request.body.read}**" | ||
request.env.merge!(:body => request.body.read).to_json | ||
end | ||
|
||
delete '/**' do | ||
puts request.inspect | ||
puts "**#{request.body.read}**" | ||
request.env.merge!(:body => request.body.read).to_json | ||
end |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.