public
Description: Practical Ruby Projects's first chapter
Clone URL: git://github.com/rubbish/livemidi.git
Added spec for hooking into initialize
rubbish (author)
Mon Jul 07 17:55:25 -0700 2008
commit  9574910426992a72acaf0d2091de504daec5a688
tree    b107f55d82b8c96810fa2fcf177f87172d8b5603
parent  5aad9f0416395ef5032d59c66bcbb19b7f5263b2
...
107
108
109
 
 
 
 
 
 
 
 
 
 
 
 
 
 
110
111
...
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
0
@@ -107,5 +107,19 @@ describe LiveMidi do
0
   it "should be hookable" do
0
     LiveMidi.include?(Hookable).should be_true
0
   end
0
+
0
+ it "should have hooks for initialize" do
0
+ class LiveMidi
0
+
0
+ add_hook_for :initialize, :something_called
0
+
0
+ attr_reader :something_was_called
0
+ def something_called
0
+ @something_was_called = true
0
+ end
0
+ end
0
+ livemidi = LiveMidi.new
0
+ livemidi.something_was_called.should be_true
0
+ end
0
   
0
 end

Comments

    No one has commented yet.