From c549d29d8e7d408e906078fcd73fa2f6f72f5cd9 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Wed, 4 Mar 2015 16:44:13 +0000 Subject: [PATCH] test that Aspell is killed by timeout --- services/spelling/test/unit/coffee/ASpellTests.coffee | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/services/spelling/test/unit/coffee/ASpellTests.coffee b/services/spelling/test/unit/coffee/ASpellTests.coffee index 94a997d424..4153c5f127 100644 --- a/services/spelling/test/unit/coffee/ASpellTests.coffee +++ b/services/spelling/test/unit/coffee/ASpellTests.coffee @@ -51,10 +51,11 @@ describe "ASpell", -> describe "when the request times out", -> beforeEach (done) -> words = ("abcdefg" for i in [0..1000]) - @ASpell.ASPELL_TIMEOUT = 100 - @start = new Date() + @ASpell.ASPELL_TIMEOUT = 1 + @start = Date.now() @ASpell.checkWords "en", words, (error, @result) => done() it "should return in reasonable time", (done) -> + delta = Date.now()-@start + delta.should.be.below(@ASpell.ASPELL_TIMEOUT + 10) done() -