Module: Jasmine

Defined in:
lib/jax/generators/app/templates/spec/javascripts/support/jasmine_config.rb,
lib/jax/monkeypatch/jasmine/config.rb,
lib/jax/monkeypatch/jasmine/server.rb,
lib/jax/generators/app/templates/spec/javascripts/support/jasmine_config.rb

Overview

Note - this is necessary for rspec2, which has removed the backtrace

Defined Under Namespace

Classes: Config, RunAdapter, SpecBuilder

Class Method Summary collapse

Class Method Details

.app(config) ⇒ Object

overridden so that we can map source files separately from /public



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/jax/monkeypatch/jasmine/server.rb', line 27

def self.app(config)
  Rack::Builder.app do
    use Rack::Head
    
    map("/run.html")  { run Jasmine::Redirect.new('/') }
    map("/__suite__") { run Jasmine::FocusedSuite.new(config) }
    
    map("/__JASMINE_ROOT__") { run Rack::File.new(Jasmine.root) }
    map(config.spec_path) { run Rack::File.new(config.project_root) }
    map(config.root_path) { run Rack::File.new(config.project_root) }
    
    map '/' do
      run Rack::Cascade.new([
        Rack::URLMap.new(
          '/' => Rack::File.new(config.root_dir),
          '/__src__' => Rack::File.new(config.src_dir)
        ),
      
        Jasmine::RunAdapter.new(config)
      ])
    end
  end
end