         if portableAtomHomeNaturallyExists
           fs.renameSync(portableAtomHomeBackupPath, portableAtomHomePath) if not fs.existsSync(portableAtomHomePath)
         else
-          rimraf.sync(portableAtomHomePath) if fs.existsSync(portableAtomHomePath)
-        rimraf.sync(portableAtomHomeBackupPath) if fs.existsSync(portableAtomHomeBackupPath)
+          fs.removeSync(portableAtomHomePath) if fs.existsSync(portableAtomHomePath)
+        fs.removeSync(portableAtomHomeBackupPath) if fs.existsSync(portableAtomHomeBackupPath)
 
       describe "with .atom directory sibling to exec", ->
         beforeEach ->

path = require "path"
fs = require 'fs-plus'
temp = require "temp"
rimraf = require "rimraf"
AtomPortable = require "../src/browser/atom-portable"

describe "Set Portable Mode on #win32", ->

    if portableAtomHomeNaturallyExists
      fs.renameSync(portableAtomHomeBackupPath, portableAtomHomePath) if not fs.existsSync(portableAtomHomePath)
    else
      fs.removeSync(portableAtomHomePath) if fs.existsSync(portableAtomHomePath)
    fs.removeSync(portableAtomHomeBackupPath) if fs.existsSync(portableAtomHomeBackupPath)

  it "creates a portable home directory", ->
    expect(fs.existsSync(portableAtomHomePath)).toBe false
