Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: f44d6bd6f3
Fetching contributors…

Cannot retrieve contributors at this time

37 lines (30 sloc) 0.741 kB
require 'sinatra/base'
require 'json'
class DummyStubServer < Sinatra::Base
[:get, :post, :put, :delete].each do |verb|
send(verb, //) do
if request.fullpath =~ /_raise_http_(\d{3})/
status $1
end
content_type :json
{method: verb, url: request.fullpath, params: params}.to_json
end
end
class << self
attr_accessor :base_url
end
end
RSpec.configure do |config|
config.before(:suite) do
q = Queue.new
Thread.fork do
DummyStubServer.set(:port, 0)
DummyStubServer.set(:server, %w[webrick])
DummyStubServer.run! do |server|
Viadeo::Client.base_url = "http://localhost:#{server.config[:Port]}/"
q.push :go!
end
end
q.pop
end
end
Jump to Line
Something went wrong with that request. Please try again.