Navigation Menu

Skip to content

Commit

Permalink
Add test for --print-synonyms
Browse files Browse the repository at this point in the history
  • Loading branch information
piroor committed Aug 9, 2012
1 parent 7d68128 commit 75175f2
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions test/gcs-commands.test.js
Expand Up @@ -425,10 +425,8 @@ suite('gcs-configure-text-options', function() {
teardown(commonTeardown);

test('load synonyms', function() {
new Domain('companies', context).createSync();
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'),
Expand All @@ -445,6 +443,32 @@ suite('gcs-configure-text-options', function() {
done(e);
});
});

test('print synonyms', function() {
var domain = new Domain('companies', context);
domain.createSync();
domain.updateSynonymsSync({
hokkaido: 'dekkaido',
tokyo: ['tonkin', 'tokio']
});
utils
.run('gcs-configure-text-options',
'--domain-name', 'companies',
'--print-synonyms',
'--database-path', temporaryDatabase.path)
.next(function(result) {
assert.deepEqual({ code: result.code,
message: result.output.stdout },
{ code: 0,
message: 'hokkaido,dekkaido\n' +
'tokyo,tokio,tonkin\n' },
result.output.stderr);
done();
})
.error(function(e) {
done(e);
});
});
});

suite('gcs-index-documents', function() {
Expand Down

0 comments on commit 75175f2

Please sign in to comment.