test/spec_session_pool.rb in rack-1.4.1 vs test/spec_session_pool.rb in rack-1.4.2

- old
+ new

@@ -1,6 +1,7 @@ require 'thread' +require 'rack/lint' require 'rack/mock' require 'rack/session/pool' describe Rack::Session::Pool do session_key = Rack::Session::Pool::DEFAULT_OPTIONS[:key] @@ -10,31 +11,33 @@ env["rack.session"]["counter"] ||= 0 env["rack.session"]["counter"] += 1 Rack::Response.new(env["rack.session"].inspect).to_a end - session_id = lambda do |env| + session_id = Rack::Lint.new(lambda do |env| Rack::Response.new(env["rack.session"].inspect).to_a - end + end) - nothing = lambda do |env| + nothing = Rack::Lint.new(lambda do |env| Rack::Response.new("Nothing").to_a - end + end) - drop_session = lambda do |env| + drop_session = Rack::Lint.new(lambda do |env| env['rack.session.options'][:drop] = true incrementor.call(env) - end + end) - renew_session = lambda do |env| + renew_session = Rack::Lint.new(lambda do |env| env['rack.session.options'][:renew] = true incrementor.call(env) - end + end) - defer_session = lambda do |env| + defer_session = Rack::Lint.new(lambda do |env| env['rack.session.options'][:defer] = true incrementor.call(env) - end + end) + + incrementor = Rack::Lint.new(incrementor) it "creates a new cookie" do pool = Rack::Session::Pool.new(incrementor) res = Rack::MockRequest.new(pool).get("/") res["Set-Cookie"].should.match session_match