Add a reproduction case for this issue :(

This commit is contained in:
R. Tyler Croy 2011-12-21 15:06:22 -08:00
parent e7b27a4dd5
commit 8598aa1f21
7 changed files with 60 additions and 0 deletions

1
.rvmrc Normal file
View File

@ -0,0 +1 @@
rvm use ruby-1.8.7@async-sinatra-test-bug --create

7
Gemfile Normal file
View File

@ -0,0 +1,7 @@
source :gemcutter
gem "rake"
gem "async_sinatra"
gem "rack-test"
gem "cucumber"
gem "rspec"

11
app/server.rb Normal file
View File

@ -0,0 +1,11 @@
require 'rubygems'
require 'sinatra/async'
class AsyncTest < Sinatra::Base
register Sinatra::Async
aget '/' do
body "hello"
end
end

0
config.ru Normal file
View File

View File

@ -0,0 +1,12 @@
Given /^I am a bug$/ do
end
When /^I get "([^"]*)"$/ do |arg1|
aget '/'
em_async_continue
end
Then /^I should asplode$/ do
last_response.body.should == "hello"
end

23
features/support/env.rb Normal file
View File

@ -0,0 +1,23 @@
ENV["RACK_ENV"] = 'test'
require 'rspec'
require 'test/unit'
require 'rack/test'
require "sinatra/async/test"
require File.expand_path(File.dirname(__FILE__) + "/../../app/server")
module AppRunner
def app
AsyncTest.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

6
features/test.feature Normal file
View File

@ -0,0 +1,6 @@
Feature: Herp
Scenario: Derp
Given I am a bug
When I get "/"
Then I should asplode