Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 20 lines (16 sloc) 0.609 kb
355d117 Ryan Tomayko Require 'test/spec' explicitly in all tests
rtomayko authored
1 require 'test/spec'
50fd7a3 Pratik Rack::Evil - The name says it all
lifo authored
2 require 'rack/mock'
3 require 'rack/contrib/evil'
4 require 'erb'
5
6 context "Rack::Evil" do
7 app = lambda do |env|
8 template = ERB.new("<%= throw :response, [404, {'Content-Type' => 'text/html'}, 'Never know where it comes from'] %>")
9 [200, {'Content-Type' => 'text/plain'}, template.result(binding)]
10 end
11
12 specify "should enable the app to return the response from anywhere" do
13 status, headers, body = Rack::Evil.new(app).call({})
14
15 status.should.equal 404
16 headers['Content-Type'].should.equal 'text/html'
17 body.should.equal 'Never know where it comes from'
18 end
19 end
Something went wrong with that request. Please try again.