summaryrefslogtreecommitdiffstats
path: root/spec/node_spec.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-01-03 22:32:20 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2012-01-03 22:32:20 +0100
commit0ea8b5b51b5825e7c69c3b0ed1f987166de6b598 (patch)
tree1c018b00c8fe2d2c61498a089891a933a1736acd /spec/node_spec.rb
parent0464c6ec58614e428a595d8fc1c79641774afd4c (diff)
downloadzorglub-0ea8b5b51b5825e7c69c3b0ed1f987166de6b598.zip
zorglub-0ea8b5b51b5825e7c69c3b0ed1f987166de6b598.tar.gz
spec: add before_all and after_all specs
Diffstat (limited to 'spec/node_spec.rb')
-rw-r--r--spec/node_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/node_spec.rb b/spec/node_spec.rb
index 84eb013..fad2a45 100644
--- a/spec/node_spec.rb
+++ b/spec/node_spec.rb
@@ -82,6 +82,29 @@ describe Zorglub do
h[:view].should == vu
end
#
+ it "before_all hook should work" do
+ Node1.before = 0
+ Node1.after = 0
+ Node1.before.should == 0
+ Node1.call( {'PATH_INFO'=>'/index'} )
+ Node1.before.should == 1
+ Node1.call( {'PATH_INFO'=>'/index'} )
+ Node1.before.should == 2
+ Node1.call( {'PATH_INFO'=>'/index'} )
+ Node1.before.should == 3
+ end
+ #
+ it "after_all hook should work" do
+ Node1.before = 0
+ Node1.after = 0
+ Node1.after.should == 0
+ Node1.call( {'PATH_INFO'=>'/index'} )
+ Node1.after.should == 1
+ Node1.call( {'PATH_INFO'=>'/index'} )
+ Node1.after.should == 2
+ Node1.call( {'PATH_INFO'=>'/index'} )
+ Node1.after.should == 3
+ end
end
#
end