From 06cdcaa82098fe9b529e1d612e061fbf087afd6d Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 2 Jul 2012 19:21:24 -0600 Subject: [PATCH] Use fs.md5ForPath in spec-helpert o ensure sample.js isn't modified --- spec/spec-helper.coffee | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index fdef0f987..5ff852fcc 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -154,18 +154,5 @@ $.fn.textInput = (data) -> $.fn.simulateDomAttachment = -> $('').append(this) -throw "Sample.js is modified" unless fs.read(require.resolve('fixtures/sample.js')) == """ - var quicksort = function () { - var sort = function(items) { - if (items.length <= 1) return items; - var pivot = items.shift(), current, left = [], right = []; - while(items.length > 0) { - current = items.shift(); - current < pivot ? left.push(current) : right.push(current); - } - return sort(left).concat(pivot).concat(sort(right)); - }; - - return sort(Array.apply(this, arguments)); - }; -""" +unless fs.md5ForPath(require.resolve('fixtures/sample.js')) == "dd38087d0d7e3e4802a6d3f9b9745f2b" + throw "Sample.js is modified"