File: dynamap.rb

package info (click to toggle)
libinnate-ruby 2010.07-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 812 kB
  • ctags: 621
  • sloc: ruby: 4,242; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 553 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require File.expand_path('../../helper', __FILE__)

describe Innate::DynaMap do
  @app = lambda{|env| [200, {}, ['pass']] }

  should 'raise if nothing is mapped' do
    lambda{ Innate::DynaMap.call({}) }.should.raise(RuntimeError)
  end

  should 'not raise if something is mapped' do
    Innate.map('/', &@app)
    Innate::DynaMap.call('SCRIPT_NAME' => '/').should == [200, {}, ['pass']]
  end

  should 'return mapped object' do
    Innate.at('/').should == @app
  end

  should 'return path to object' do
    Innate.to(@app).should == '/'
  end
end