Skip to content

Instantly share code, notes, and snippets.

@jamesalmond
Created November 8, 2010 11:37
Show Gist options
  • Save jamesalmond/667614 to your computer and use it in GitHub Desktop.
Save jamesalmond/667614 to your computer and use it in GitHub Desktop.
Using the test helpers in the async_sinatra library to drive cucumber tests
ENV["RACK_ENV"] = 'test'
require 'rspec'
require 'test/unit'
require 'rack/test'
require "sinatra/async/test"
module AppRunner
def app
My::App.new
end
end
World(Test::Unit::Assertions, Sinatra::Async::Test::Methods, AppRunner)
def post_json(path,json)
header 'Content-Type', 'application/json'
apost path, json.to_json
em_async_continue
last_response
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment