[Groonga-commit] ranguba/epub-searcher at 6936b81 [master] Extract common methods as parent class's ones

Back to archive index

KITAITI Makoto null+****@clear*****
Tue Dec 23 07:16:35 JST 2014


KITAITI Makoto	2014-12-23 07:16:35 +0900 (Tue, 23 Dec 2014)

  New Revision: 6936b817005a20760e67e1e2a3a37fd90b1de594
  https://github.com/ranguba/epub-searcher/commit/6936b817005a20760e67e1e2a3a37fd90b1de594

  Message:
    Extract common methods as parent class's ones

  Modified files:
    test/epub-searcher/database_test.rb

  Modified: test/epub-searcher/database_test.rb (+13 -23)
===================================================================
--- test/epub-searcher/database_test.rb    2014-12-23 06:26:53 +0900 (32a05fd)
+++ test/epub-searcher/database_test.rb    2014-12-23 07:16:35 +0900 (6658a80)
@@ -6,21 +6,21 @@ require 'epub-searcher/database'
 require 'epub-searcher/epub-document'
 
 class TestDatabase < Test::Unit::TestCase
-  class TestSetup < self
-    def setup
-      @database = EPUBSearcher::Database.new
-      @database.db_path = db_path
-      remove_db_directory
-    end
+  def setup
+    @database = EPUBSearcher::Database.new
+    @database.db_path = db_path
+    remove_db_directory
+  end
 
-    def teardown
-      remove_db_directory
-    end
+  def teardown
+    remove_db_directory
+  end
 
-    def remove_db_directory
-      FileUtils.rm_rf(File.dirname(@database.db_path))
-    end
+  def remove_db_directory
+    FileUtils.rm_rf(File.dirname(@database.db_path))
+  end
 
+  class TestSetup < self
     def test_setup_database
       @database.setup_database
 
@@ -34,20 +34,10 @@ class TestDatabase < Test::Unit::TestCase
 
   class TestLoadRecords < self
     def setup
-      @database = EPUBSearcher::Database.new
-      @database.db_path = db_path
-      remove_db_directory
+      super
       @database.setup_database
     end
 
-    def teardown
-      remove_db_directory
-    end
-
-    def remove_db_directory
-      FileUtils.rm_rf(File.dirname(@database.db_path))
-    end
-
     def test_load_epub_documents
       documents = Array.new
       documents << EPUBSearcher::EPUBDocument.open(fixture_path('empty_contributors_single_spine.epub'))
-------------- next part --------------
HTML����������������������������...
Descargar 



More information about the Groonga-commit mailing list
Back to archive index