Created
August 25, 2012 11:33
-
-
Save manadart/3464182 to your computer and use it in GitHub Desktop.
async_sinatra cannot determine application with Sinatra 1.3.3
This file contains hidden or 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 'sinatra/base' | |
require 'sinatra/async' | |
class MyApp < Sinatra::Base | |
register Sinatra::Async | |
configure do | |
set :raise_errors, false | |
set :show_exceptions, false | |
enable :logging | |
end | |
aget '/' do | |
body 'Big time!' | |
end | |
end |
This file contains hidden or 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 'rspec' | |
require 'test/unit' | |
require 'eventmachine' | |
require 'sinatra/async/test' | |
require_relative '../app' | |
ENV['RACK_ENV'] = 'test' | |
RSpec.configure do |config| | |
config.include Test::Unit::Assertions | |
config.include Sinatra::Async::Test::Methods | |
end | |
describe 'MyApp', :type => :request do | |
def app | |
MyApp.new | |
end | |
it 'can access the base route.' do | |
aget '/' | |
last_response.status.should eq 200 | |
end | |
end |
This file contains hidden or 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
Failures: | |
1) MyApp can access the base route. | |
Failure/Error: aget '/' | |
RuntimeError: | |
Cannot determine sinatra application from #<struct Sinatra::ExtendedRack app=#<Rack::Head:0xa0c5490 @app=#<Sinatra::CommonLogger:0xa0c54a4 @app=#<Rack::Logger:0xa0c54e0 @app=#<Rack::Protection::FrameOptions:0xa0c5580 @app=#<Rack::Protection::IPSpoofing:0xa0c55f8 @app=#<Rack::Protection::JsonCsrf:0xa0c574c @app=#<Rack::Protection::PathTraversal:0xa0c57d8 @app=#<Rack::Protection::XSSHeader:0xa0c5878 @app=#<MyApp:0xa0c61c4 @default_layout=:layout, @app=nil, @template_cache=#<Tilt::Cache:0xa0c61b0 @cache={}>>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :xss_mode=>:block, :except=>[:session_hijacking, :remote_token]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :except=>[:session_hijacking, :remote_token]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :except=>[:session_hijacking, :remote_token]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :except=>[:session_hijacking, :remote_token]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :xss_mode=>:block, :frame_options=>:sameorigin, :except=>[:session_hijacking, :remote_token]}>, @level=1>, @logger=nil>>> | |
# ./app_spec.rb:20:in `block (2 levels) in <top (required)>' | |
Finished in 0.05393 seconds | |
1 example, 1 failure |
FYI if others encounter this:
There's a PR here that's never been merged.
Just get the fix from Soffes' fork.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Same here. Scratching my head over this :(