 CSON = require 'season'
 
 defs = CSON.readFileSync("#{__dirname}/../snippets/language-haskell.cson")
+
+open = (what) ->
+  atom.workspace.open("#{__dirname}/fixture/#{what}")
 
 describe "Snippets", ->
   [editorElement, editor, Snippets] = []

  describe 'c2hs', ->
    beforeEach ->
      waitsForPromise ->
        atom.workspace.open('sample.chs')
      runs ->
        editor = atom.workspace.getActiveTextEditor()
        editorElement = atom.views.getView(editor)

  describe 'hsc2hs', ->
    beforeEach ->
      waitsForPromise ->
        open('sample.hsc')
      runs ->
        editor = atom.workspace.getActiveTextEditor()
        editorElement = atom.views.getView(editor)
