From 8ff76bc41d2b8cc94ef19075bd63a9654ce48f2b Mon Sep 17 00:00:00 2001 From: Glavin Wiechert Date: Thu, 11 Jun 2015 18:51:36 -0300 Subject: [PATCH] Fix typo in php-cs-fixer spec, mocking env should be object --- spec/beautifier-php-cs-fixer-spec.coffee | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/spec/beautifier-php-cs-fixer-spec.coffee b/spec/beautifier-php-cs-fixer-spec.coffee index 8f5a376..e04d286 100644 --- a/spec/beautifier-php-cs-fixer-spec.coffee +++ b/spec/beautifier-php-cs-fixer-spec.coffee @@ -39,17 +39,21 @@ describe "PHP-CS-Fixer Beautifier", -> fixers: "" levels: "" } - # Mock - beautifier.getShellEnvironment = -> Promise.resolve("") + # Mock PATH + beautifier.getShellEnvironment = -> Promise.resolve({ + PATH: '' + }) # p = beautifier.beautify(text, language, options) expect(p).not.toBe(null) expect(p instanceof beautifier.Promise).toBe(true) cb = (v) -> - console.log(v) + # console.log(v) expect(v).not.toBe(null) - expect(v instanceof Error).toBe(true) - expect(v.code).toBe("CommandNotFound") + expect(v instanceof Error).toBe(true, \ + "Expected #{v} to be instance of Error") + expect(v.code).toBe("CommandNotFound", \ + "Expected to be CommandNotFound") return v p.then(cb, cb) return p