Navigation Menu

Skip to content

Commit

Permalink
Add test for configure-text-options
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Aug 9, 2012
1 parent a6451af commit bcc9a57
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/fixture/synonyms.txt
@@ -0,0 +1,2 @@
tokyo,tonkin,tokio
hokkaido,dekkaido
22 changes: 22 additions & 0 deletions test/gcs-commands.test.js
@@ -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;

Expand Down Expand Up @@ -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() {
Expand Down
4 changes: 4 additions & 0 deletions test/test-utils.js
Expand Up @@ -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');
Expand Down

0 comments on commit bcc9a57

Please sign in to comment.