Move toExistOnDisk matcher to spec helper

This commit is contained in:
Corey Johnson
2013-03-12 16:55:28 -07:00
parent c236325c1a
commit 3ec74f3211
2 changed files with 5 additions and 6 deletions

View File

@@ -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

View File

@@ -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)