Created
December 1, 2011 12:44
-
-
Save mostlyobvious/1416456 to your computer and use it in GitHub Desktop.
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 'em-spec/test' | |
require 'exceptioner_api/application' | |
require 'logger' | |
ENV['EXCEPTIONER_HOST'] ||= '127.0.0.1' | |
ENV['EXCEPTIONER_PORT'] ||= '1234' | |
class Exceptioner::API::TestCase < Test::Unit::TestCase | |
include EM::TestHelper | |
attr_reader :app_uri | |
def run(result, &block) | |
host, port = ENV['EXCEPTIONER_HOST'], ENV['EXCEPTIONER_PORT'].to_i | |
klass = Exceptioner::API::Application | |
server = Goliath::Server.new(host, port) | |
server.logger = Logger.new('/dev/null') | |
server.app = Goliath::Rack::Builder.build(klass, klass.new) | |
server.api = klass.new | |
server.plugins = [] | |
server.options = {} | |
em do | |
server.start | |
output = begin | |
super | |
ensure | |
done | |
end | |
output | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment