[Groonga-commit] groonga/gcs [master] Add test for configure-text-options

Back to archive index

null+****@clear***** null+****@clear*****
2012年 8月 9日 (木) 16:04:48 JST


SHIMODA Hiroshi	2012-08-09 16:04:48 +0900 (Thu, 09 Aug 2012)

  New Revision: bcc9a5703e3bc0cb432993cf77820e9508719918
  https://github.com/groonga/gcs/commit/bcc9a5703e3bc0cb432993cf77820e9508719918

  Log:
    Add test for configure-text-options

  Added files:
    test/fixture/synonyms.txt
  Modified files:
    test/gcs-commands.test.js
    test/test-utils.js

  Added: test/fixture/synonyms.txt (+2 -0) 100644
===================================================================
--- /dev/null
+++ test/fixture/synonyms.txt    2012-08-09 16:04:48 +0900 (517eff4)
@@ -0,0 +1,2 @@
+tokyo,tonkin,tokio
+hokkaido,dekkaido

  Modified: test/gcs-commands.test.js (+22 -0)
===================================================================
--- test/gcs-commands.test.js    2012-08-09 15:54:05 +0900 (f02a7ae)
+++ test/gcs-commands.test.js    2012-08-09 16:04:48 +0900 (67ac8ae)
@@ -1,5 +1,6 @@
 var utils = require('./test-utils');
 var assert = require('chai').assert;
+var path = require('path');
 
 var Domain = require('../lib/database/domain').Domain;
 
@@ -423,6 +424,27 @@ suite('gcs-configure-text-options', function() {
   setup(commonSetup);
   teardown(commonTeardown);
 
+  test('load synonyms', {
+    utils
+      .run('gcs-create-domain',
+           '--domain-name', 'companies',
+           '--database-path', temporaryDatabase.path)
+      .run('gcs-configure-text-options',
+           '--domain-name', 'companies',
+           '--synonyms', path.join(__dirname, 'fixtures', 'synonyms.txt'),
+           '--database-path', temporaryDatabase.path)
+      .next(function(result) {
+        assert.deepEqual({ code:    result.code,
+                           message: result.output.stdout },
+                         { code:    0,
+                           message: '2 synonyms are loaded.\n' },
+                         result.output.stderr);
+        done();
+      })
+      .error(function(e) {
+        done(e);
+      });
+  });
 });
 
 suite('gcs-index-documents', function() {

  Modified: test/test-utils.js (+4 -0)
===================================================================
--- test/test-utils.js    2012-08-09 15:54:05 +0900 (14a4c89)
+++ test/test-utils.js    2012-08-09 16:04:48 +0900 (19ca47e)
@@ -183,6 +183,10 @@ exports.run = run;
 Deferred.register('run', function() { return run.apply(this, arguments); });
 
 
+exports.resolve = function(possibleRelativePath) {
+  return path.resolve(process.cwd(), possibleRelativePath);
+};
+
 // activate diff for chai.assert.deepEqual
 
 var chai_utils = require('chai/lib/chai/utils');
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Download 



Groonga-commit メーリングリストの案内
Back to archive index