forked from rack/rack
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
darcs-hash:20070303095652-4fc50-7a15fec375f8b2a4ac86b3cf957f8fb3ad1008f9.gz
- Loading branch information
1 parent
b29366b
commit 7ade69b
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
require 'test/spec' | ||
|
||
require 'rack/lobster' | ||
require 'rack/mock' | ||
|
||
context "Rack::Lobster::LambdaLobster" do | ||
specify "should be a single lambda" do | ||
Rack::Lobster::LambdaLobster.should.be.kind_of Proc | ||
end | ||
|
||
specify "should look like a lobster" do | ||
res = Rack::MockRequest.new(Rack::Lobster::LambdaLobster).get("/") | ||
res.should.be.ok | ||
res.body.should.include "(,(,,(,,,(" | ||
res.body.should.include "?flip" | ||
end | ||
|
||
specify "should be flippable" do | ||
res = Rack::MockRequest.new(Rack::Lobster::LambdaLobster).get("/?flip") | ||
res.should.be.ok | ||
res.body.should.include "(,,,(,,(,(" | ||
end | ||
end | ||
|
||
context "Rack::Lobster" do | ||
specify "should look like a lobster" do | ||
res = Rack::MockRequest.new(Rack::Lobster.new).get("/") | ||
res.should.be.ok | ||
res.body.should.include "(,(,,(,,,(" | ||
res.body.should.include "?flip" | ||
res.body.should.include "crash" | ||
end | ||
|
||
specify "should be flippable" do | ||
res = Rack::MockRequest.new(Rack::Lobster.new).get("/?flip=left") | ||
res.should.be.ok | ||
res.body.should.include "(,,,(,,(,(" | ||
end | ||
|
||
specify "should provide crashing for testing purposes" do | ||
lambda { | ||
Rack::MockRequest.new(Rack::Lobster.new).get("/?flip=crash") | ||
}.should.raise | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters