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: 98,582 of 180,702
Downloads: 7,103

Daily

Ranking: 18,420 of 180,689
Downloads: 37

Depended by

RankDownloadsName

Depends on

RankDownloadsName
10887,360,111rack
117262,140,378sinatra
223143,611,496yard
22,19657,241inventory
32,80233,486lookout
34,12831,704inventory-rake
34,40431,370inventory-rake-tasks-yard
50,96718,743yard-heuristics
60,99214,717lookout-rake

Owners

#GravatarHandle
1iconnow