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

Version Path
classiccms-0.7.5 vendor/bundle/gems/rack-1.4.1/test/spec_config.rb
classiccms-0.7.4 vendor/bundle/gems/rack-1.4.1/test/spec_config.rb
classiccms-0.7.3 vendor/bundle/gems/rack-1.4.1/test/spec_config.rb
candlepin-api-0.4.0 bundle/ruby/gems/rack-1.3.5/test/spec_config.rb
candlepin-api-0.4.0 bundle/ruby/1.9.1/gems/rack-1.3.5/test/spec_config.rb
candlepin-api-0.4.0 bundle/ruby/1.8/gems/rack-1.3.5/test/spec_config.rb
classiccms-0.7.2 vendor/bundle/gems/rack-1.4.1/test/spec_config.rb
classiccms-0.7.1 vendor/bundle/gems/rack-1.4.1/test/spec_config.rb
classiccms-0.7.0 vendor/bundle/gems/rack-1.4.1/test/spec_config.rb
rack-1.3.10 test/spec_config.rb
rack-1.2.8 test/spec_config.rb
rack-1.3.9 test/spec_config.rb
rack-1.2.7 test/spec_config.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/test/spec_config.rb
rack-1.3.8 test/spec_config.rb
rack-1.3.7 test/spec_config.rb
rack-1.2.6 test/spec_config.rb
challah-0.9.0 vendor/bundle/gems/rack-1.4.1/test/spec_config.rb
classiccms-0.6.9 vendor/bundle/gems/rack-1.4.1/test/spec_config.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/rack-1.4.1/test/spec_config.rb