Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'No data received' when running Jasmine specs

When I run bundle exec rake jasmine then browse to http://localhost:8888/ I see the following error message:

No data received
Unable to load the web page because the server sent no data.
Error 324 (net::ERR_EMPTY_RESPONSE): The server closed the connection without sending any data.

In the console, I see:

[2012-02-08 07:54:08] INFO  WEBrick 1.3.1
[2012-02-08 07:54:08] INFO  ruby 1.9.2 (2011-07-09) [i686-linux]
[2012-02-08 07:54:08] WARN  TCPServer Error: Address already in use - bind(2)
[2012-02-08 07:54:08] INFO  WEBrick::HTTPServer#start: pid=12078 port=8888
[2012-02-08 07:54:10] ERROR ArgumentError: wrong number of arguments (2 for 0)
        /home/duncan/.rvm/gems/ruby-1.9.2-p290/gems/railroady-1.0.6/tasks/railroady.rake:11:in `format'
        /home/duncan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:110:in `service'
        /home/duncan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run'
        /home/duncan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'
[2012-02-08 07:54:10] ERROR ArgumentError: wrong number of arguments (3 for 0)
        /home/duncan/.rvm/gems/ruby-1.9.2-p290/gems/railroady-1.0.6/tasks/railroady.rake:11:in `format'
        /home/duncan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpversion.rb:46:in `to_s'
        /home/duncan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpresponse.rb:49:in `status_line'
        /home/duncan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpresponse.rb:170:in `send_header'
        /home/duncan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpresponse.rb:102:in `send_response'
        /home/duncan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/httpserver.rb:86:in `run'
        /home/duncan/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread'

The structure of the spec/javascripts directory is:

spec/javascripts/
├── helpers
│   ├── jasmine_helpers.js.coffee
│   ├── jasmine-jquery-1.3.1.js
│   └── mock-ajax.js
├── models
│   ├── account_spec.js.coffee
│   ├── matrices_spec.js.coffee
│   ├── matrix_spec.js.coffee
│   └── students_spec.js.coffee
├── support
│   ├── jasmine_config.rb
│   ├── jasmine_runner.rb
│   └── jasmine.yml
└── views
    ├── avia_view_spec.js.coffee
    ├── matrices_view_spec.js.coffee
    ├── students_view_spec.js.coffee
    └── student_view_spec.js.coffee

My jasmine.yml file contains:

src_dir: app/assets/javascripts

asset_paths:
  - app/assets/javascripts/views

src_files:
  - avia.js
  - jquery-1.6.4.js
  - jquery.jqGrid.min.js
  - underscore.js
  - backbone.js
  - haml.js
  - "**/*"

stylesheets:
  - stylesheets/**/*.css

helpers:
  - helpers/**/*.js
  - helpers/**/*.js.coffee

spec_files:
  - '**/*_spec.js.coffee'

spec_dir: spec/javascripts

My Gem versions are as follows (I've included what I think are the relevant ones; let me know if you require a full list):

  • coffee-filter (0.1.1)
  • coffee-rails (3.1.1)
  • coffee-script (2.2.0)
  • coffee-script-source (1.2.0)
  • jasmine (1.1.2)
  • jasmine-core (1.1.0)
  • jasmine-headless-webkit (0.9.0.rc1 4f11cba)
  • jasmine-rails (0.0.2)
  • railroady (1.0.6)
  • rails (3.1.0)
  • rake (0.9.2.2)
  • sprockets (2.0.3)
  • therubyracer (0.9.9)

I'm running Chrome 16.0.912.77 on Linux Mint 12, using Ruby 1.9.2-p290 through RVM.

This setup works fine through jasmine-headless-webkit:

Running Jasmine specs...
............................
PASS: 28 tests, 0 failures, 0.076 secs.

Perhaps I'm doing something in my jasmine.yml that isn't supported by jasmine-gem?

like image 539
Duncan Bayne Avatar asked Nov 13 '22 10:11

Duncan Bayne


1 Answers

use latest source code. thanks @avaynshtok for pointing issue & sending pull request!

 gem 'railroady', :git => "git://github.com/preston/railroady.git"
like image 73
Sandip Ransing Avatar answered Jan 24 '23 05:01

Sandip Ransing