ri > Rack::MockRequest

🔗 Rack::MockRequest < Object

🚀 Quick Reference

Use CaseCommandDescription
Perform a GET requestRack::MockRequest.new(app).get("/url")Simulate a GET request to the Rack application
Perform a POST request with inputRack::MockRequest.new(app).post("/url", :input => "data")Simulate a POST request with rack.input set
Enable lint checkingRack::MockRequest.new(app, :lint => true).get("/url")Wrap the app in Rack::Lint during testing
Handle fatal errorsRack::MockRequest.new(app, :fatal => true).get("/url")Raise a FatalWarning if app writes to rack.errors

📝 Description

Rack::MockRequest helps testing your Rack application without actually using HTTP.

After performing a request on a URL with get/post/put/patch/delete, it returns a MockResponse with useful helper methods for effective testing.

You can pass a hash with additional configuration to the get/post/put/patch/delete.

💡 Constants

🛠️ Class methods

⚡ Instance methods

Rack::MockRequest
🔗 Rack::MockRequest < Object 🚀 Quick Reference 📝 Description 💡 Constants 🛠️ Class methods ⚡ Instance methods

Generated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-27 16:44 @216.73.216.194
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Valid XHTML 1.0 Transitional!Valid CSS!
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format