Note that there are some explanatory texts on larger screens.

plurals
  1. POClasses defined in CoffeeScript not found by Jasmine specs
    primarykey
    data
    text
    <p>I am building a backbone.js app on a Rails 3.1 back-end. I'm using CoffeeScript to write the backbone classes, and Jasmine (via jasmine-headless-webkit) for testing.</p> <p>Given the following (partial) tree:</p> <pre><code>. ├── app │   ├── assets │   │   ├── javascripts │   │   │   └── views │   │   │   ├── avia_view.js.coffee ├── spec │   ├── javascripts │   │   └── views │   │   └── avia_view_spec.js.coffee </code></pre> <p>... I would expect <code>avia_view_spec.js.coffee</code> to know about <code>Avia.AviaView</code>, which is defined in <code>avia_view.js.coffee</code>.</p> <p>However, I get the following output from running <code>bundle exec jasmine-headless-webkit</code>:</p> <pre><code>Running Jasmine specs... F Avia.AviaView render creates a new MatricesView . (/home/duncan/avia/spec/javascripts/views/avia_view_spec.js.coffee:10) ReferenceError: Can't find variable: Avia in /home/duncan/avia/spec/javascripts/views/avia_view_spec.js.coffee (line ~5) ReferenceError: Can't find variable: Avia in /home/duncan/avia/spec/javascripts/views/avia_view_spec.js.coffee (line ~10) </code></pre> <p>My <code>jasmine.yml</code> contains the following:</p> <pre><code>src_files: - public/javascripts/prototype.js - public/javascripts/effects.js - public/javascripts/controls.js - public/javascripts/dragdrop.js - public/javascripts/application.js - public/javascripts/**/*.js </code></pre> <p>I <em>think</em> I need to tell Jasmine to load the contents of <code>avia_view.js.coffee</code> but I'm not entirely sure how. Adding an explicit reference in the <code>src_files</code> section in <code>jasmine.yml</code> doesn't seem to make a difference ...</p> <p>Could someone please tell me what I'm doing wrong here? I suspect it's something simple ...</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload