breaking out into separate files
[sinatra.git] / test / event_dsl_test.rb
blobc88cfe6aa4d19bc7f259c0cf4e892ca7b830348f
1 require File.dirname(__FILE__) + '/helper'
3 context "Event's DSL" do
4   
5   setup do
6     Sinatra.reset!
7   end
8   
9   specify "takes multiple routes" do
10     
11     get '/', '/foo' do
12       'hello from me'
13     end
14     
15     get_it '/'
16     should.be.ok
17     body.should.equal 'hello from me'
18     
19     get_it '/foo'
20     should.be.ok
21     body.should.equal 'hello from me'
22     
23   end
24   
25   specify "should be able to halt from within request" do
26     
27     get '/halting' do
28       throw :halt, 'halted'
29       'not this'
30     end
31     
32     get_it '/halting'
33     
34     should.be.ok
35     body.should.equal 'halted'
36     
37   end
38   
39 end