 
   describe "::backwardsScan(regex, fn)", ->
     beforeEach ->
-      buffer = new TextBuffer(filePath: require.resolve('./fixtures/sample.js'))
-      buffer.loadSync()
+      buffer = TextBuffer.loadSync(require.resolve('./fixtures/sample.js'))
 
     it "calls the given function with the information about each match in backwards order", ->
       matches = []

    beforeEach (done) ->
      filePath = require.resolve('./fixtures/sample.js')
      fileContents = fs.readFileSync(filePath, 'utf8')
      buffer = new TextBuffer({filePath, load: false})
      buffer.load().then ->
        changeHandler = jasmine.createSpy('changeHandler')
        buffer.onDidChange changeHandler
        done()

  describe "::scanInRange(range, regex, fn)", ->
    beforeEach ->
      filePath = require.resolve('./fixtures/sample.js')
      buffer = TextBuffer.loadSync(filePath)

    describe "when given a regex with a ignore case flag", ->
      it "does a case-insensitive search", ->
