Categories: None [Edit]
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
Downloads Trends
Ranking Trends
Num of Versions Trends
Popular Versions (Major)
Popular Versions (Major.Minor)
Depended by
Rank | Downloads | Name |
---|
Depends on
Rank | Downloads | Name |
---|---|---|
9 | 973,358,941 | rack |
122 | 281,877,677 | sinatra |
224 | 158,681,269 | yard |
22,630 | 58,827 | inventory |
33,429 | 34,289 | lookout |
34,575 | 32,744 | inventory-rake |
34,879 | 32,346 | inventory-rake-tasks-yard |
51,549 | 19,282 | yard-heuristics |
61,713 | 15,140 | lookout-rake |
Owners
# | Gravatar | Handle |
---|---|---|
1 | now |