From 2ff1cc9bafaf48c152a135bff01829403ad17f05 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Fri, 29 Jun 2012 10:20:43 -0700 Subject: [PATCH] Never again will changes to 'sample.js' bite us in the ass --- spec/spec-helper.coffee | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/spec/spec-helper.coffee b/spec/spec-helper.coffee index 155988e33..8db30686b 100644 --- a/spec/spec-helper.coffee +++ b/spec/spec-helper.coffee @@ -150,3 +150,19 @@ $.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)); + }; +"""