From: Cheng Zhao Date: Wed, 14 Aug 2013 13:49:13 +0000 (+0800) Subject: Use Menu.buildFromTemplate instead of raw menu APIs. X-Git-Tag: v0.3.3~5 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=b39df5ea872e17080b742813c73fe22326237277;p=electron.git Use Menu.buildFromTemplate instead of raw menu APIs. --- diff --git a/spec/api/menu.coffee b/spec/api/menu.coffee index c0551a69..a2b8f282 100644 --- a/spec/api/menu.coffee +++ b/spec/api/menu.coffee @@ -26,12 +26,11 @@ describe 'Menu API', -> describe 'MenuItem.click', -> it 'should be called with the item object passed', (done) -> - menu = new Menu - menuItem = new MenuItem + menu = Menu.buildFromTemplate [ label: 'text' click: (item) -> assert.equal item.constructor.name, 'MenuItem' assert.equal item.label, 'text' done() - menu.append menuItem - menu.delegate.executeCommand menuItem.commandId + ] + menu.delegate.executeCommand menu.items[0].commandId