spec/lib/rack/harakiri_spec.rb in picky-3.5.3 vs spec/lib/rack/harakiri_spec.rb in picky-3.5.4
- old
+ new
@@ -1,9 +1,9 @@
# encoding: utf-8
require 'spec_helper'
-describe Picky::Rack::Harakiri do
+describe Rack::Harakiri do
before(:each) do
@app = stub :app
Process.stub! :kill # not taking any chances
end
context "defaults" do
@@ -14,44 +14,44 @@
@ronin.instance_variable_get(:@quit_after_requests).should == 50
end
describe 'harakiri?' do
it "should be true after 50 harakiri calls" do
50.times { @ronin.harakiri }
-
+
@ronin.harakiri?.should == true
end
it "should not be true after just 49 harakiri calls" do
49.times { @ronin.harakiri }
-
+
@ronin.harakiri?.should == false
end
end
describe "harakiri" do
it "should kill the process after 50 harakiri calls" do
Process.should_receive(:kill).once
-
+
50.times { @ronin.harakiri }
end
it "should not kill the process after 49 harakiri calls" do
Process.should_receive(:kill).never
-
+
49.times { @ronin.harakiri }
end
end
describe "call" do
before(:each) do
@app.stub! :call
@app.stub! :harakiri
end
it "calls harakiri" do
@ronin.should_receive(:harakiri).once.with
-
+
@ronin.call :env
end
it "calls the app" do
@app.should_receive(:call).once.with :env
-
+
@ronin.call :env
end
end
end
context "with harakiri set" do
@@ -64,7 +64,7 @@
end
it "should quit after an amount of requests" do
@ronin.instance_variable_get(:@quit_after_requests).should == 100
end
end
-
+
end
\ No newline at end of file