test/live_server.rb in faraday-0.7.5 vs test/live_server.rb in faraday-0.7.6
- old
+ new
@@ -1,8 +1,20 @@
require 'sinatra'
set :logging, false
+[:get, :post, :put, :patch, :delete, :options].each do |method|
+ send(method, '/echo') do
+ kind = request.request_method.downcase
+ out = kind.dup
+ out << ' ?' << request.GET.inspect if request.GET.any?
+ out << ' ' << request.POST.inspect if request.POST.any?
+
+ content_type 'text/plain'
+ return out
+ end
+end
+
get '/hello_world' do
'hello world'
end
get '/json' do
@@ -39,7 +51,12 @@
delete '/delete_with_json' do
%/{"deleted":true}/
end
get '/multi' do
- [200, { 'Set-Cookie' => %w[ one two ] }, '']
+ [200, { 'Set-Cookie' => 'one, two' }, '']
+end
+
+get '/slow' do
+ sleep 10
+ [200, {}, 'ok']
end