Skip to content

Commit

Permalink
Fix spec failures and warnings in Rack::Lock under 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
rtomayko committed Feb 6, 2009
1 parent 8c80996 commit b7939fc
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/spec_rack_lock.rb
Expand Up @@ -20,21 +20,19 @@ def synchronize
specify "should call synchronize on lock" do
lock = Lock.new
env = Rack::MockRequest.env_for("/")
app = Rack::Lock.new(lambda { }, lock)
app = Rack::Lock.new(lambda { |env| }, lock)
lock.synchronized.should.equal false
app.call(env)
lock.synchronized.should.equal true
end

specify "should set multithread flag to false" do
env = Rack::MockRequest.env_for("/")
app = Rack::Lock.new(lambda { |env| env['rack.multithread'] })
app.call(env).should.equal false
app.call(Rack::MockRequest.env_for("/")).should.equal false
end

specify "should reset original multithread flag when exiting lock" do
env = Rack::MockRequest.env_for("/")
app = Rack::Lock.new(lambda { |env| env })
app.call(env)['rack.multithread'].should.equal true
app.call(Rack::MockRequest.env_for("/"))['rack.multithread'].should.equal true
end
end

0 comments on commit b7939fc

Please sign in to comment.