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)); + }; +"""