[Tomoe-cvs 1168] CVS update: tomoe/test

Back to archive index

Kouhei Sutou kous****@users*****
2006年 11月 27日 (月) 16:49:18 JST


Index: tomoe/test/dict_spec.rb
diff -u tomoe/test/dict_spec.rb:1.5 tomoe/test/dict_spec.rb:1.6
--- tomoe/test/dict_spec.rb:1.5	Mon Nov 27 15:58:41 2006
+++ tomoe/test/dict_spec.rb	Mon Nov 27 16:49:18 2006
@@ -57,9 +57,17 @@
   end
 
   specify "should load and save" do
-    dict = Tomoe::Dict.new(@dict_file.path, true)
-    truncate_content
-    dict.save
+    dicts = ObjectSpace.each_object(Tomoe::Dict) {}
+    Proc.new do
+      Tomoe::Dict.new(@dict_file.path, true)
+      truncate_content
+      nil
+    end
+
+    GC.start # GCed Tomoe::Dict to ensure save
+    current_dicts = ObjectSpace.each_object(Tomoe::Dict) {}
+    current_dicts.should <= dicts
+
     content.should == @dict_content
   end
 


tomoe-cvs メーリングリストの案内
Back to archive index