mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Move toExistOnDisk matcher to spec helper
This commit is contained in:
@@ -137,6 +137,11 @@ addCustomMatchers = (spec) ->
|
||||
this.message = => "Expected object with length #{@actual.length} to#{notText} have length #{expected}"
|
||||
@actual.length == expected
|
||||
|
||||
toExistOnDisk: (expected) ->
|
||||
notText = this.isNot and " not" or ""
|
||||
@message = -> return "Expected path '" + @actual + "'" + notText + " to exist."
|
||||
fs.exists(@actual)
|
||||
|
||||
window.keyIdentifierForKey = (key) ->
|
||||
if key.length > 1 # named key
|
||||
key
|
||||
|
||||
@@ -37,12 +37,6 @@ describe 'Package Generator', ->
|
||||
packagePath = "/tmp/atom-packages/#{packageName}"
|
||||
fs.remove(packagePath) if fs.exists(packagePath)
|
||||
|
||||
@addMatchers
|
||||
toExistOnDisk: (expected) ->
|
||||
notText = this.isNot and " not" or ""
|
||||
@message = -> return "Expected path '" + @actual + "'" + notText + " to exist."
|
||||
fs.exists(@actual)
|
||||
|
||||
afterEach ->
|
||||
fs.remove(packagePath) if fs.exists(packagePath)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user