sinatra 1.2.9 → 1.3.0.a

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of sinatra might be problematic. Click here for more details.

@@ -1,45 +0,0 @@
1
- require File.expand_path('../helper', __FILE__)
2
- require 'rack'
3
-
4
- class RackTest < Test::Unit::TestCase
5
- setup do
6
- @foo = Sinatra.new { get('/foo') { 'foo' }}
7
- @bar = Sinatra.new { get('/bar') { 'bar' }}
8
- end
9
-
10
- def build(*middleware)
11
- endpoint = middleware.pop
12
- @app = Rack::Builder.app do
13
- middleware.each { |m| use m }
14
- run endpoint
15
- end
16
- end
17
-
18
- def check(*middleware)
19
- build(*middleware)
20
- assert get('/foo').ok?
21
- assert_body 'foo'
22
- assert get('/bar').ok?
23
- assert_body 'bar'
24
- end
25
-
26
- it 'works as middleware in front of Rack::Lock, with lock enabled' do
27
- @foo.enable :lock
28
- check(@foo, Rack::Lock, @bar)
29
- end
30
-
31
- it 'works as middleware behind Rack::Lock, with lock enabled' do
32
- @foo.enable :lock
33
- check(Rack::Lock, @foo, @bar)
34
- end
35
-
36
- it 'works as middleware in front of Rack::Lock, with lock disabled' do
37
- @foo.disable :lock
38
- check(@foo, Rack::Lock, @bar)
39
- end
40
-
41
- it 'works as middleware behind Rack::Lock, with lock disabled' do
42
- @foo.disable :lock
43
- check(Rack::Lock, @foo, @bar)
44
- end
45
- end