Use atom-shell's "shell.beep()" to replace "$native.beep()"

This commit is contained in:
Cheng Zhao
2013-05-20 09:49:34 +08:00
parent 1301eb0fa4
commit 177ac5687f
2 changed files with 7 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
fsUtils = require 'fs-utils'
PEG = require 'pegjs'
shell = require 'shell'
module.exports =
class CommandInterpreter
@@ -19,4 +20,4 @@ class CommandInterpreter
address.execute(@project, activeEditSession).done ->
currentSelectionRange = activeEditSession.getSelection().getBufferRange()
$native.beep() if previousSelectionRange.isEqual(currentSelectionRange)
shell.beep() if previousSelectionRange.isEqual(currentSelectionRange)

View File

@@ -1,5 +1,6 @@
RootView = require 'root-view'
CommandPanelView = require 'command-panel/lib/command-panel-view'
shell = require 'shell'
_ = require 'underscore'
describe "CommandPanel", ->
@@ -253,10 +254,10 @@ describe "CommandPanel", ->
commandPanel.execute("/Array")
runs ->
expect(editSession.getSelectedBufferRange()).toEqual [[11,14], [11,19]]
spyOn($native, 'beep')
spyOn(shell, 'beep')
rootView.trigger 'command-panel:repeat-relative-address'
waitsFor ->
$native.beep.callCount > 0
shell.beep.callCount > 0
runs ->
expect(editSession.getSelectedBufferRange()).toEqual [[11,14], [11,19]]
@@ -280,10 +281,10 @@ describe "CommandPanel", ->
commandPanel.execute("/Array")
runs ->
expect(editSession.getSelectedBufferRange()).toEqual [[11,14], [11,19]]
spyOn($native, 'beep')
spyOn(shell, 'beep')
rootView.trigger 'command-panel:repeat-relative-address-in-reverse'
waitsFor ->
$native.beep.callCount > 0
shell.beep.callCount > 0
runs ->
expect(editSession.getSelectedBufferRange()).toEqual [[11,14], [11,19]]