       # Opening another existing file in the same directory reuses the window,
       # and opens a new tab for the file.
       waitsForPromise ->
-        startAnotherAtom([tempFilePath])
+        startAnotherAtom(tempFilePath)
         driver.wait ->
           driver.executeScript(-> atom.workspace.getActivePane().getItems().length).then (length) ->
             length is 2

  afterEach ->
    waitsForPromise -> driver.quit().thenFinally(-> chromeDriver.kill())

  startAtom = (args=[]) ->
    driver = new Builder()
      .usingServer("http://localhost:#{ChromeDriverPort}")
      .withCapabilities(


      # Opening a different directory creates a new window.
      waitsForPromise ->
        startAnotherAtom(temp.mkdirSync("another-empty-dir"))
        driver.wait ->
          driver.getAllWindowHandles().then (handles) ->
            handles.length is 2

  describe "when given the name of a directory that exists", ->
    beforeEach ->
      startAtom(tempDirPath)

    it "opens a new window no text editors open", ->
      waitsForPromise ->
