Categories: None [Edit]

lookout-rack

https://rubygems.org/gems/lookout-rack
Lookout-Rack Lookout-Rack provides easy interaction with Rack¹ from Lookout². It provides you with a session connected to your Rack application through which you can make requests, check responses, follow redirects and set, inspect, and clear cookies. ¹ See http://rack.rubyforge.org/ ² See http://disu.se/software/lookout/ § Installation Install Lookout-Rack with % gem install lookout-rack § Usage Include the following code in your ‹Rakefile› (provided that you’re using Lookout-Rake¹): require 'lookout-rack-3.0' Lookout::Rake::Tasks::Test.new do |t| t.requires << 'lookout-rack-3.0' end ¹ See http://disu.se/software/lookout-rake/ Then set up a ‹fixtures/config.ru› file that Lookout-Rack will use for loading your Rack app. load 'path/to/app.rb' use Rack::Lint run Path::To::App This file, if it exists, will be loaded during the first call to #session. If it doesn’t exist, ‹config.ru› will be used instead. You can now test your app: Expectations do expect 200 do session.get('/').response.status end end The #session method returns an object that lets you #get, #post, #put, and #delete resources from the Rack app. You call these method with a URI¹ that you want to access/modify together with any parameters that you want to pass and any Rack environment that you want to use (which isn’t very common). For example, let’s get ‹/pizzas/› with olives on them: expect 200 do session.get('/pizzas/', 'olives' => '1').response.status end ¹ Abbreviation for Uniform Resource Identifier The #response method on #session returns a mock Rack response object that can be queried for results. Similarly, there’s a #request method that lets you inspect the request that was made. Lookout-Rack also deals with cookies. Assuming that ‹/cookies/set/› will set any ...

Total

Ranking: 99,593 of 183,107
Downloads: 7,289

Daily

Ranking: 35,920 of 183,092
Downloads: 3

Depended by

RankDownloadsName

Depends on

RankDownloadsName
9973,358,941rack
122281,877,677sinatra
224158,681,269yard
22,63058,827inventory
33,42934,289lookout
34,57532,744inventory-rake
34,87932,346inventory-rake-tasks-yard
51,54919,282yard-heuristics
61,71315,140lookout-rake

Owners

#GravatarHandle
1iconnow