Skip to content

Instantly share code, notes, and snippets.

@fanktom
Created August 7, 2012 09:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fanktom/3283556 to your computer and use it in GitHub Desktop.
Save fanktom/3283556 to your computer and use it in GitHub Desktop.
Goliath API with_api call succeeding although it shouldn't
require 'goliath'
require 'eventmachine'
require 'em-synchrony'
require 'em-synchrony/em-hiredis'
class Server < Goliath::API
def response(env)
@redis = EM::Hiredis.connect
@redis.brpop "waiting_for_ever", 0
[200, {}, "popped!"]
end
end
require './timeout'
require 'goliath/test_helper'
RSpec.configure do |config|
config.include Goliath::TestHelper
config.treat_symbols_as_metadata_keys_with_true_values = true
end
describe Server do
it "should wait for ever" do
with_api(Server) do
get_request :path => "/" do
puts "Request returned.."
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment