Created
August 7, 2012 09:03
-
-
Save fanktom/3283556 to your computer and use it in GitHub Desktop.
Goliath API with_api call succeeding although it shouldn't
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
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 |
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
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