                     resolve()
 
     it 'should read lower case name from grammar', ->
-        grammar = atom.grammars.getGrammars()[0]
-        expect(kernelManager.getLanguageFor grammar).toEqual('null grammar')
+        expect(kernelManager.getLanguageFor mockGrammar)
+            .toEqual('grammarlanguage')
 
     it 'should update kernelspecs', ->
         waitsForPromise -> new Promise (resolve, reject) ->

    kernelSpecs.kernelspecs.python2 = secondKernelSpec.kernelspecs.python2
    kernelSpecsString = JSON.stringify kernelSpecs

    kernelManager = null

    beforeEach ->
        kernelManager = new KernelManager()
        atom.config.set 'Hydrogen.kernelspec', ''

    describe 'getKernelSpecsFromSettings', ->
        it 'should parse kernelspecs from settings', ->


path = require 'path'
fs = require 'fs'
_ = require 'lodash'

describe 'Kernel manager', ->
    firstKernelSpecString = '''{
