I just installed the Jasmine gem and ran the Rails generators. When I
start use rake jasmine and go to localhost:8888, all the bundled tests
fail, starting with this one:
Player
when song has been paused
should indicate that the song is currently paused
TypeError: Player is not a constructor in
http://localhost:8888/__spec__/PlayerSpec.js
(line 6)
([object Object])@
http://localhost:8888/__JASMINE_ROOT__/lib/
jasmine.js:94 ([object Error])@
http://localhost:8888/__JASMINE_ROOT__/
lib/jasmine.js:1965 ((function () {if (jasmine.Queue.LOOP_DONT_RECURSE
&& calledSynchronously) {completedSynchronously = true;return;}if
(self.blocks[self.index].abort) {self.abort = true;}self.offset =
0;self.index++;var now = (new Date).getTime();if
(self.env.updateInterval && now - self.env.lastUpdate >
self.env.updateInterval) {self.env.lastUpdate =
now;self.env.setTimeout(function () {self.next_();}, 0);} else {if
(jasmine.Queue.LOOP_DONT_RECURSE && completedSynchronously) {goAgain =
true;} else {self.next_();}}}))@
http://localhost:8888/__JASMINE_ROOT__/
lib/jasmine.js:970 ()@
http://localhost:8888/__JASMINE_ROOT__/lib/
jasmine.js:1739
Here is my spec/javascripts/support/jasmine.yml
# src_files
#
# Return an array of filepaths relative to src_dir to include before
jasmine specs.
# Default: []
#
# EXAMPLE:
#
# src_files:
# - lib/source1.js
# - lib/source2.js
# - dist/**/*.js
#
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
# stylesheets
#
# Return an array of stylesheet filepaths relative to src_dir to
include before jasmine specs.
# Default: []
#
# EXAMPLE:
#
# stylesheets:
# - css/style.css
# - stylesheets/*.css
#
stylesheets:
- stylesheets/**/*.css
# helpers
#
# Return an array of filepaths relative to spec_dir to include before
jasmine specs.
# Default: ["helpers/**/*.js"]
#
# EXAMPLE:
#
# helpers:
# - helpers/**/*.js
#
helpers:
- helpers/**/*.js
# spec_files
#
# Return an array of filepaths relative to spec_dir to include.
# Default: ["**/*[sS]pec.js"]
#
# EXAMPLE:
#
# spec_files:
# - **/*[sS]pec.js
#
spec_files:
- **/*[sS]pec.js
# src_dir
#
# Source directory path. Your src_files must be returned relative to
this path. Will use root if left blank.
# Default: project root
#
# EXAMPLE:
#
# src_dir: public
#
src_dir:
# spec_dir
#
# Spec directory path. Your spec_files must be returned relative to
this path.
# Default: spec/javascripts
#
# EXAMPLE:
#
# spec_dir: spec/javascripts
#
spec_dir: spec/javascripts
One thing of note...if I set my src_dir to public, I get errors that
Player is not defined at all, so I know it is finding the source JS
files.
Is there something I missed in the configuration? Thanks for your
help.
- Jeff Sutherland