Sha256: c93bdbfd932030e8866a11b8bc591e4c9eefafdfb5ebb540086823bf183bbfa2
Contents?: true
Size: 574 Bytes
Versions: 149
Compression:
Stored size: 574 Bytes
Contents
require 'rack/builder' require 'rack/config' require 'rack/content_length' require 'rack/lint' require 'rack/mock' describe Rack::Config do should "accept a block that modifies the environment" do app = Rack::Builder.new do use Rack::Lint use Rack::ContentLength use Rack::Config do |env| env['greeting'] = 'hello' end run lambda { |env| [200, {'Content-Type' => 'text/plain'}, [env['greeting'] || '']] } end response = Rack::MockRequest.new(app).get('/') response.body.should.equal('hello') end end
Version data entries
149 entries across 128 versions & 16 rubygems