public this repo is viewable by everyone
Description: Merb Core: All you need. None you don't.
Homepage: http://www.merbivore.com
Clone URL: git://github.com/wycats/merb-core.git
Initial specs for Merb::SessionMixin
5 days ago
commit  1a01f84b098a8936a123e2fcf91a5cd219a2e35c
tree    388579a67a5e098a8f249697d5ef68297c52d8d6
parent  df27240a0654cafe29807277063c78fb0e97e64b
...
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
0
@@ -0,0 +1,47 @@
0
+require File.join(File.dirname(__FILE__), "spec_helper")
0
+Merb.start :environment => "test"
0
+
0
+describe Merb::SessionMixin do
0
+
0
+ before :each do
0
+ @first_session_finalizer_executed = false
0
+ @second_session_finalizer_executed = false
0
+
0
+ @first_session_persisting_callback_executed = false
0
+ @second_session_persisting_callback_executed = false
0
+ end
0
+
0
+ it "stores session finalizing callbacks in a collection" do
0
+ Merb::SessionMixin.finalize_session_exception_callbacks do
0
+ @first_session_finalizer_executed = true
0
+ end
0
+
0
+ Merb::SessionMixin.finalize_session_exception_callbacks do
0
+ @second_session_finalizer_executed = true
0
+ end
0
+
0
+ Merb::SessionMixin.finalize_session_exception_callbacks.each { |callback| callback.call }
0
+
0
+ @first_session_finalizer_executed.should == true
0
+ @second_session_finalizer_executed.should == true
0
+ end
0
+
0
+ it "stores session persist callbacks in a collection" do
0
+ Merb::SessionMixin.persist_exception_callbacks do
0
+ @first_session_finalizer_executed = true
0
+ end
0
+
0
+ Merb::SessionMixin.persist_exception_callbacks do
0
+ @second_session_finalizer_executed = true
0
+ end
0
+
0
+ Merb::SessionMixin.persist_exception_callbacks.each { |callback| callback.call }
0
+
0
+ @first_session_finalizer_executed.should == true
0
+ @second_session_finalizer_executed.should == true
0
+ end
0
+
0
+ it "generates random 32 character uuid string" do
0
+ Merb::SessionMixin.rand_uuid.size.should == 32
0
+ end
0
+end

Comments

    No one has commented yet.