macournoyer / invisible

The invisible framework

This URL has Read+Write access

macournoyer (author)
Tue Mar 24 18:32:34 -0700 2009
commit  2333383a458b24ededd8ce6fa3a6ade206cf7d12
tree    4904e35eb8a43ea936b047e31e7554e42223f538
parent  30454dd44d4b67b676d2d98fbb078c99ea49d464
invisible / spec / with_spec.rb
100644 28 lines (23 sloc) 0.542 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require File.dirname(__FILE__) + "/spec_helper"
 
describe "with" do
  before do
    @app = Invisible.new do
      with "/with" do
        get "/get" do
          render "get"
        end
        
        with "/double" do
          get "/again" do
            render "again"
          end
        end
      end
    end
  end
  
  it "should allow nesting with" do
    @app.mock.get("/with/get").body.should == "get"
  end
 
  it "should allow nesting multiple withs" do
    @app.mock.get("/with/double/again").body.should == "again"
  end
end