diff options
Diffstat (limited to 'spec/node_spec.rb')
-rw-r--r-- | spec/node_spec.rb | 23 |
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 |