forked from ddollar/rack-maintenance
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6bb3fb6
commit 54f5d8e
Showing
1 changed file
with
24 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,29 @@ | ||
require File.expand_path(File.dirname(__FILE__) + '/spec_helper') | ||
require 'fileutils' | ||
|
||
describe "RackMaintenance" do | ||
it "fails" do | ||
fail "hey buddy, you should probably rename this file and start specing for real" | ||
let(:app) { Class.new { def call(env); end }.new } | ||
let(:rack) { Rack::Maintenance.new(app, :file => "spec/maintenance.html") } | ||
|
||
context "without maintenance file" do | ||
it "calls the app" do | ||
app.should_receive(:call).once | ||
rack.call({}) | ||
end | ||
end | ||
|
||
context "with maintenance file" do | ||
before do | ||
FileUtils.touch 'spec/maintenance.html' | ||
end | ||
|
||
after do | ||
FileUtils.rm 'spec/maintenance.html' | ||
end | ||
|
||
it "does not call the app" do | ||
app.should_not_receive :call | ||
rack.call({}) | ||
end | ||
end | ||
end |