isEnabled -> platformSupportsUpdates

This commit is contained in:
Ben Ogle
2016-02-25 17:32:02 -08:00
parent bc138f727e
commit 68951494d2
2 changed files with 8 additions and 8 deletions

View File

@@ -64,7 +64,7 @@ describe('AutoUpdateManager (renderer)', () => {
})
})
describe('::isEnabled', () => {
describe('::platformSupportsUpdates', () => {
let platform, releaseChannel
it('returns true on OS X and Windows, when in stable', () => {
spyOn(autoUpdateManager, 'getPlatform').andCallFake(() => platform)
@@ -72,27 +72,27 @@ describe('AutoUpdateManager (renderer)', () => {
platform = 'win32'
releaseChannel = 'stable'
expect(autoUpdateManager.isEnabled()).toBe(true)
expect(autoUpdateManager.platformSupportsUpdates()).toBe(true)
platform = 'win32'
releaseChannel = 'dev'
expect(autoUpdateManager.isEnabled()).toBe(false)
expect(autoUpdateManager.platformSupportsUpdates()).toBe(false)
platform = 'darwin'
releaseChannel = 'stable'
expect(autoUpdateManager.isEnabled()).toBe(true)
expect(autoUpdateManager.platformSupportsUpdates()).toBe(true)
platform = 'darwin'
releaseChannel = 'dev'
expect(autoUpdateManager.isEnabled()).toBe(false)
expect(autoUpdateManager.platformSupportsUpdates()).toBe(false)
platform = 'linux'
releaseChannel = 'stable'
expect(autoUpdateManager.isEnabled()).toBe(false)
expect(autoUpdateManager.platformSupportsUpdates()).toBe(false)
platform = 'linux'
releaseChannel = 'dev'
expect(autoUpdateManager.isEnabled()).toBe(false)
expect(autoUpdateManager.platformSupportsUpdates()).toBe(false)
})
})

View File

@@ -37,7 +37,7 @@ export default class AutoUpdateManager {
ipcRenderer.send('install-update')
}
isEnabled () {
platformSupportsUpdates () {
return this.getReleaseChannel() == 'stable' && (this.getPlatform() === 'darwin' || this.getPlatform() === 'win32')
}