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
initforthe-cookies-0.0.1 vendor/bundle/gems/rack-1.4.1/test/spec_config.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/test/spec_config.rb
sunrise-cms-0.3.2 vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/test/spec_config.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/test/spec_config.rb
sunrise-cms-0.3.1 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/test/spec_config.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/test/spec_config.rb
sunrise-cms-0.3.0 vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/test/spec_config.rb
rails-uploader-0.0.4 vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/test/spec_config.rb
classiccms-0.3.8 vendor/bundle/gems/rack-1.4.1/test/spec_config.rb
challah-0.6.1 vendor/bundle/gems/rack-1.4.1/test/spec_config.rb
classiccms-0.3.7 vendor/bundle/gems/rack-1.4.1/test/spec_config.rb
classiccms-0.3.6 vendor/bundle/gems/rack-1.4.1/test/spec_config.rb
classiccms-0.3.5 vendor/bundle/gems/rack-1.4.1/test/spec_config.rb
classiccms-0.3.4 vendor/bundle/gems/rack-1.4.1/test/spec_config.rb
classiccms-0.3.3 vendor/bundle/gems/rack-1.4.1/test/spec_config.rb
classiccms-0.3.2 vendor/bundle/gems/rack-1.4.1/test/spec_config.rb
classiccms-0.3.1 vendor/bundle/gems/rack-1.4.1/test/spec_config.rb
classiccms-0.3.0 vendor/bundle/gems/rack-1.4.1/test/spec_config.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rails-uploader-0.0.1/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/test/spec_config.rb
sunrise-cms-0.3.0.rc vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/test/spec_config.rb