             start
               = a:"a" &{return a is "a"}
           '''
-          expect(parser.parse "a").to.eql ["a", ""]
+          expect(tryParse parser, "a").to.eql ["a", ""]
         
         test 'can use the |offset| variable to get the current parse position', ->
           parser = PEG.buildParser '''
             start
               = "a" &{return offset is 1}
           '''
-          expect(parser.parse "a").to.eql ["a", ""]
+          expect(tryParse parser, "a").to.eql ["a", ""]
 
         test 'can use the |line| and |column| variables to get the current line and column', ->
           parser = PEG.buildParser '''

    suite 'simple CoffeeScript', ->
      test 'action', ->
        parser = PEG.buildParser 'start = "a" { return "#{1+1}" }'
        expect(parser.parse "a").to.equal "2"
        
      test 'initializer', ->
        parser = PEG.buildParser '''

  expect = global.expect
  PEG = global.PEG
  PEGCoffee = global.PEGCoffee


# Helper functions
tryParse = (parser, text) ->
  try
    result = parser.parse(text)
  catch e
    result = e
  return result


# Test suite for the plugin  
