Rename isFile() to isFileSync()

This commit is contained in:
Kevin Sawicki
2013-06-12 18:21:57 -07:00
parent 86952ff85e
commit 400aa93bf3
16 changed files with 31 additions and 31 deletions

View File

@@ -15,9 +15,9 @@ describe "install(commandPath, callback)", ->
it "symlinks the command and makes it executable", ->
fsUtils.write(commandPath, 'test')
expect(fsUtils.isFile(commandPath)).toBeTruthy()
expect(fsUtils.isFileSync(commandPath)).toBeTruthy()
expect(fsUtils.isExecutable(commandPath)).toBeFalsy()
expect(fsUtils.isFile(destinationPath)).toBeFalsy()
expect(fsUtils.isFileSync(destinationPath)).toBeFalsy()
installDone = false
installError = null
@@ -29,6 +29,6 @@ describe "install(commandPath, callback)", ->
runs ->
expect(installError).toBeNull()
expect(fsUtils.isFile(destinationPath)).toBeTruthy()
expect(fsUtils.isFileSync(destinationPath)).toBeTruthy()
expect(fs.realpathSync(destinationPath)).toBe fs.realpathSync(commandPath)
expect(fsUtils.isExecutable(destinationPath)).toBeTruthy()

View File

@@ -9,18 +9,18 @@ describe "fsUtils", ->
it "does not through an exception when the path is a binary file", ->
expect(-> fsUtils.read(require.resolve("fixtures/binary-file.png"))).not.toThrow()
describe ".isFile(path)", ->
describe ".isFileSync(path)", ->
fixturesDir = fsUtils.resolveOnLoadPath('fixtures')
it "returns true with a file path", ->
expect(fsUtils.isFile(path.join(fixturesDir, 'sample.js'))).toBe true
expect(fsUtils.isFileSync(path.join(fixturesDir, 'sample.js'))).toBe true
it "returns false with a directory path", ->
expect(fsUtils.isFile(fixturesDir)).toBe false
expect(fsUtils.isFileSync(fixturesDir)).toBe false
it "returns false with a non-existent path", ->
expect(fsUtils.isFile(path.join(fixturesDir, 'non-existent'))).toBe false
expect(fsUtils.isFile(null)).toBe false
expect(fsUtils.isFileSync(path.join(fixturesDir, 'non-existent'))).toBe false
expect(fsUtils.isFileSync(null)).toBe false
describe ".exists(path)", ->
it "returns true when path exsits", ->