sinatra 1.2.9 → 1.3.0.a
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of sinatra might be problematic. Click here for more details.
- data/CHANGES +12 -118
- data/Gemfile +23 -37
- data/LICENSE +1 -1
- data/README.de.rdoc +11 -15
- data/README.es.rdoc +50 -76
- data/README.fr.rdoc +7 -7
- data/README.hu.rdoc +1 -1
- data/README.jp.rdoc +2 -8
- data/README.pt-br.rdoc +1 -1
- data/README.pt-pt.rdoc +1 -1
- data/README.rdoc +64 -139
- data/README.ru.rdoc +618 -68
- data/README.zh.rdoc +7 -7
- data/Rakefile +6 -29
- data/lib/sinatra.rb +3 -0
- data/lib/sinatra/base.rb +115 -179
- data/lib/sinatra/main.rb +1 -1
- data/lib/sinatra/rack.rb +44 -0
- data/lib/sinatra/showexceptions.rb +3 -3
- data/sinatra.gemspec +5 -4
- data/test/coffee_test.rb +11 -15
- data/test/delegator_test.rb +3 -43
- data/test/helper.rb +0 -4
- data/test/helpers_test.rb +44 -37
- data/test/nokogiri_test.rb +6 -5
- data/test/result_test.rb +4 -4
- data/test/routing_test.rb +8 -132
- data/test/server_test.rb +2 -3
- data/test/settings_test.rb +0 -26
- data/test/slim_test.rb +25 -15
- data/test/static_test.rb +1 -0
- metadata +17 -67
- data/test/rack_test.rb +0 -45
data/test/rack_test.rb
DELETED
@@ -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
|