[Groonga-commit] ranguba/epub-searcher at 2aff856 [master] Extract common #setup/#teardown from subclasses of TestRemoteDatabase

Back to archive index

KITAITI Makoto null+****@clear*****
Thu Dec 25 01:20:41 JST 2014


KITAITI Makoto	2014-12-25 01:20:41 +0900 (Thu, 25 Dec 2014)

  New Revision: 2aff8565fd70874310969a938e991adb62c06c78
  https://github.com/ranguba/epub-searcher/commit/2aff8565fd70874310969a938e991adb62c06c78

  Message:
    Extract common #setup/#teardown from subclasses of TestRemoteDatabase

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

  Modified: test/epub-searcher/remote_database_test.rb (+8 -17)
===================================================================
--- test/epub-searcher/remote_database_test.rb    2014-12-23 17:29:19 +0900 (25ed286)
+++ test/epub-searcher/remote_database_test.rb    2014-12-25 01:20:41 +0900 (ee419b1)
@@ -1,16 +1,16 @@
 require 'epub-searcher/remote-database'
 
 class TestRemoteDatabase < Test::Unit::TestCase
-  class TestSetup < self
-    def setup
-      @database = EPUBSearcher::RemoteDatabase.new(:protocol => :http)
-    end
+  def setup
+    @database = EPUBSearcher::RemoteDatabase.new(:protocol => :http)
+  end
 
-    def teardown
-      super
-      @database.close
-    end
+  def teardown
+    super
+    @database.close
+  end
 
+  class TestSetup < self
     def test_setup_database
       expected_table_create_params = [
         {:name=>:Books, :flags=>'TABLE_NO_KEY'},
@@ -40,15 +40,6 @@ class TestRemoteDatabase < Test::Unit::TestCase
   end
 
   class TestRecords < self
-    def setup
-      @database = EPUBSearcher::RemoteDatabase.new(:protocol => :http)
-    end
-
-    def teardown
-      super
-      @database.close
-    end
-
     def test_load_records
       epub_paths = [
         'empty_contributors_single_spine.epub',
-------------- next part --------------
HTML����������������������������...
Download 



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