jasmine-headless-webkit-pre.../intro/02_install.md

105 lines
2.0 KiB
Markdown
Raw Permalink Normal View History

2011-12-12 14:46:21 +00:00
!SLIDE
# Installing
!SLIDE
# Qt 4.7 or above
!SLIDE
2011-12-13 21:42:53 +00:00
# johnbintz.github.com/jasmine-headless-webkit
2011-12-12 14:46:21 +00:00
!SLIDE
2011-12-13 21:42:53 +00:00
# `gem install jasmine-headless-webkit`
2011-12-12 14:46:21 +00:00
!SLIDE
# Gemfile
@@@ ruby
gem 'jasmine-headless-webkit', '~> 0.8.0'
2011-12-14 00:37:46 +00:00
!SLIDE bullets incremental
2011-12-12 14:46:21 +00:00
# Rails 3.1 Application
2011-12-14 00:37:46 +00:00
* Asset pipeline using Sprockets
* `spec/javascripts` holds tests
!SLIDE
# The Pivotal Labs `jasmine` gem
!SLIDE
# spec/javascripts/support/jasmine.yml
!SLIDE
# Supporting the Jasmine gem conventions
2011-12-13 21:42:53 +00:00
!SLIDE
2011-12-14 00:37:46 +00:00
## (easier to convert existing projects to JHW)
2011-12-13 21:42:53 +00:00
2011-12-12 14:46:21 +00:00
!SLIDE
# spec/javascripts/support/jasmine.yml
@@@ yaml
src_dir: app/assets/javascripts
asset_paths:
- lib/assets/javascripts
- vendor/assets/javascripts
src_files: [ '**/*' ]
spec_dir: spec/javascripts
spec_files: [ '**/*[Ss]pec.*' ]
helpers: [ 'helpers/**/*' ]
!SLIDE
2011-12-13 21:42:53 +00:00
# JavaScript Load Paths
2011-12-12 14:46:21 +00:00
!SLIDE
# Sprockets and Jasmine load files differently
!SLIDE
2011-12-13 21:42:53 +00:00
# The Sprockets Way
2011-12-12 14:46:21 +00:00
!SLIDE
# spec/javascripts/support/jasmine.yml
@@@ yaml
src_dir: app/assets/javascripts
asset_paths:
- lib/assets/javascripts
- vendor/assets/javascripts
spec_dir: spec/javascripts
!SLIDE
@@@ ruby
# ...somewhere in JHW...
env.append_path "app/assets/javascripts"
env.append_path "lib/assets/javascripts"
env.append_path "vendor/assets/javascripts"
env.append_path "spec/javascripts"
!SLIDE
@@@ javascript
//= require backbone/models/cat
//= require backbone/collections/cats
//= require backbone/views/global_view
class window.CatsView extends GlobalView
!SLIDE
2011-12-13 21:42:53 +00:00
# The Jasmine Way
2011-12-12 14:46:21 +00:00
@@@ yaml
src_dir: app/assets/javascripts
src_files: [ '**/*' ]
spec_dir: spec/javascripts
spec_files: [ '**/*[Ss]pec.*' ]
helpers: [ 'helpers/**/*' ]
!SLIDE
@@@ ruby
Dir["app/assets/javascripts/**/*"]
Dir["spec/javascripts/**/*[Ss]pec.*"]
Dir["spec/javascripts/helpers/**/*"]
!SLIDE
# JHW ensures that no file is loaded twice
!SLIDE
# Ensures Sprockets dependencies are loaded in the right order