Created
March 13, 2011 08:15
-
-
Save ayamomiji/867967 to your computer and use it in GitHub Desktop.
problem in testing async sinatra app in rails 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
| class AsyncTest < Sinatra::Base | |
| register Sinatra::Async | |
| aget '/' do | |
| body "hello async" | |
| 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 'spec_helper' | |
| require 'sinatra/async/test' | |
| describe AsyncTest do | |
| include Rack::Test::Methods | |
| include Sinatra::Async::Test::Methods | |
| def app | |
| AsyncTest | |
| end | |
| describe 'AGET /' do | |
| it 'should response "hello async"' do | |
| aget '/' | |
| last_response.body.should == 'hello async' | |
| end | |
| 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
| gem 'thin' | |
| gem 'sinatra', :require => 'sinatra/base' | |
| gem 'async_sinatra', :require => 'sinatra/async' | |
| group :development, :test do | |
| gem 'rspec-rails' | |
| 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
| mount AsyncTest => '/' |
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
| F | |
| Failures: | |
| 1) AsyncTest AGET / should response "hello async" | |
| Failure/Error: aget '/' | |
| ArgumentError: | |
| wrong number of arguments (0 for 1) | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/sinatra-1.2.0/lib/sinatra/base.rb:1096:in `options' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/async_sinatra-0.5.0/lib/sinatra/async/test.rb:81:in `async_continue' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/async_sinatra-0.5.0/lib/sinatra/async/test.rb:59:in `aget' | |
| # ./spec/metals/async_test_spec.rb:14:in `block (3 levels) in <top (required)>' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/example.rb:49:in `instance_eval' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/example.rb:49:in `block (2 levels) in run' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/example.rb:106:in `with_around_hooks' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/example.rb:46:in `block in run' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/example.rb:99:in `block in with_pending_capture' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/example.rb:98:in `catch' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/example.rb:98:in `with_pending_capture' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/example.rb:45:in `run' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/example_group.rb:262:in `block in run_examples' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/example_group.rb:258:in `map' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/example_group.rb:258:in `run_examples' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/example_group.rb:232:in `run' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/example_group.rb:233:in `block in run' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/example_group.rb:233:in `map' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/example_group.rb:233:in `run' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/command_line.rb:27:in `block (2 levels) in run' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/command_line.rb:27:in `map' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/command_line.rb:27:in `block in run' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/reporter.rb:12:in `report' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/command_line.rb:24:in `run' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:55:in `run_in_process' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:46:in `run' | |
| # /home/ayaya/.rvm/gems/ruby-1.9.2-p180/gems/rspec-core-2.5.1/lib/rspec/core/runner.rb:10:in `block in autorun' | |
| Finished in 0.02255 seconds | |
| 1 example, 1 failure |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment