Update Vendored Rack to 1.2.0

Also update tests for itextomml 1.3.25.
This commit is contained in:
Jacques Distler 2010-06-13 23:09:24 -05:00
parent 4f8759cdf3
commit 6491d70326
107 changed files with 1463 additions and 2008 deletions

36
vendor/plugins/rack/spec/spec_lock.rb vendored Normal file
View file

@ -0,0 +1,36 @@
require 'rack/lock'
require 'rack/mock'
class Lock
attr_reader :synchronized
def initialize
@synchronized = false
end
def synchronize
@synchronized = true
yield
end
end
describe Rack::Lock do
should "call synchronize on lock" do
lock = Lock.new
env = Rack::MockRequest.env_for("/")
app = Rack::Lock.new(lambda { |inner_env| }, lock)
lock.synchronized.should.equal false
app.call(env)
lock.synchronized.should.equal true
end
should "set multithread flag to false" do
app = Rack::Lock.new(lambda { |env| env['rack.multithread'] })
app.call(Rack::MockRequest.env_for("/")).should.equal false
end
should "reset original multithread flag when exiting lock" do
app = Rack::Lock.new(lambda { |env| env })
app.call(Rack::MockRequest.env_for("/"))['rack.multithread'].should.equal true
end
end