       updateAvailableHandler = jasmine.createSpy("update-available-handler")
       subscription = NylasEnv.onUpdateAvailable updateAvailableHandler
 
-      autoUpdater = require('remote').require('auto-updater')
-      autoUpdater.emit 'update-downloaded', null, "notes", "version"
+      remote.autoUpdater.emit 'update-downloaded', null, "notes", "version"
 
       waitsFor ->
         updateAvailableHandler.callCount > 0

{$, $$}  = require '../src/space-pen-extensions'
Exec = require('child_process').exec
path = require 'path'
Package = require '../src/package'
ThemeManager = require '../src/theme-manager'

        expect(actualWidth).toBe inputMinWidth

    describe '::getDefaultWindowDimensions', ->
      it "returns primary display's work area size if it's small enough", ->
        spyOn(remote.screen, 'getPrimaryDisplay').andReturn workAreaSize: width: 1440, height: 900

        out = NylasEnv.getDefaultWindowDimensions()
        expect(out).toEqual x: 0, y: 0, width: 1440, height: 900

      it "caps width at 1440 and centers it, if wider", ->
        spyOn(remote.screen, 'getPrimaryDisplay').andReturn workAreaSize: width: 1840, height: 900

        out = NylasEnv.getDefaultWindowDimensions()
        expect(out).toEqual x: 200, y: 0, width: 1440, height: 900

      it "caps height at 900 and centers it, if taller", ->
        spyOn(remote.screen, 'getPrimaryDisplay').andReturn workAreaSize: width: 1440, height: 1100

        out = NylasEnv.getDefaultWindowDimensions()
        expect(out).toEqual x: 0, y: 100, width: 1440, height: 900

      it "returns only the max viewport size if it's smaller than the defaults", ->
        spyOn(remote.screen, 'getPrimaryDisplay').andReturn workAreaSize: width: 1000, height: 800

        out = NylasEnv.getDefaultWindowDimensions()
        expect(out).toEqual x: 0, y: 0, width: 1000, height: 800

      it "always rounds X and Y", ->
        spyOn(remote.screen, 'getPrimaryDisplay').andReturn workAreaSize: width: 1845, height: 955

        out = NylasEnv.getDefaultWindowDimensions()
        expect(out).toEqual x: 202, y: 27, width: 1440, height: 900
