Sha256: 8ebbdf7a4a8fdf95bdf57cdf379d54cb2ddf539195bb386a24466d28a6758e64

Contents?: true

Size: 1.34 KB

Versions: 1

Compression:

Stored size: 1.34 KB

Contents

ENV['HOME'] = File.expand_path('../data/home', __FILE__)
require 'fileutils'
require_relative "../lib/dotman"

RSpec.configure do |config|

  config.before(:each) do
    Dotman::Git.stub(:system) do |arg|
      if arg == "git clone git@github.com:Timbinous/dotfiles.git /home/tim/source/dotman/spec/data/home/.dotman/Timbinous_dotfiles"
        FileUtils.cp_r(File.expand_path('../data/Timbinous_dotfiles', __FILE__), File.join(ENV['HOME'], '.dotman'))
      end
    end
  end

  config.after(:each) do
    FileUtils.rm_rf(File.join(ENV['HOME'], '.dotman')) if File.directory? (File.join(ENV['HOME'], '.dotman'))
    FileUtils.rm(File.join(ENV['HOME'], '.bashrc')) if File.symlink? (File.join(ENV['HOME'], '.bashrc'))
    FileUtils.rm(File.join(ENV['HOME'], '.gitignore')) if File.symlink? (File.join(ENV['HOME'], '.gitignore'))
    FileUtils.rm(File.join(ENV['HOME'], '.tmux.conf')) if File.symlink? (File.join(ENV['HOME'], '.tmux.conf'))
    FileUtils.rm(File.join(ENV['HOME'], '.vim')) if File.symlink? (File.join(ENV['HOME'], '.vim'))
    FileUtils.rm(File.join(ENV['HOME'], '.vimrc')) if File.symlink? (File.join(ENV['HOME'], '.vimrc'))
    FileUtils.rm(File.join(ENV['HOME'], '.zshrc')) if File.symlink? (File.join(ENV['HOME'], '.zshrc'))
    FileUtils.rm(File.join(ENV['HOME'], 'tim.zsh-theme')) if File.symlink? (File.join(ENV['HOME'], 'tim.zsh-theme'))
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
dotman-0.0.3.3 spec/spec_helper.rb