Created
January 9, 2012 22:20
-
-
Save peterhellberg/1585299 to your computer and use it in GitHub Desktop.
ArgumentError after include Goliath::TestHelper
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
rvm --create use 1.9.3@goliath-wrong-number-of-arguments |
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
source :rubygems | |
gem "goliath", :git => "https://github.com/postrank-labs/goliath.git" | |
gem "em-http-request", :git => "https://github.com/igrigorik/em-http-request.git" | |
gem "minitest" |
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 'bundler' | |
Bundler.require | |
class MyAPI < Goliath::API | |
use Goliath::Rack::Heartbeat | |
end | |
require 'goliath/test_helper' | |
require 'minitest/pride' | |
require 'minitest/autorun' | |
require 'minitest/spec' | |
describe MyAPI do | |
include Goliath::TestHelper | |
options = { :log_stdout => false } | |
it "responds to heartbeat" do | |
with_api(MyAPI, options) do | |
get_request({:path => '/status'}) do |api| | |
api.response.must_equal 'OK' | |
end | |
end | |
end | |
end |
MiniTest and with_api
It seems like we can do something like this to disable logging per default (Seems to work just fine with MiniTest)
module Goliath
module TestHelper
def with_api(api, options = { :log_stdout => false }, &blk)
server(api, options.delete(:port) || 9900, options, &blk)
end
end
end
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Output when running the spec