Sha256: 9eb25b88cded50d7e28041f88ca4d3980a27f7d8238255cc657b66781411dd4d

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

$LOAD_PATH.unshift(File.dirname(__FILE__))
$LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
require 'homesick'
require 'rspec'
require 'rspec/autorun'
require 'construct'
require 'tempfile'

RSpec.configure do |config|
  config.include Construct::Helpers

  config.before { ENV['HOME'] = home.to_s }

  config.before { silence! }

  def silence!
    homesick.stub(:say_status)
  end

  def given_castle(path, subdirs = [])
    name = Pathname.new(path).basename
    castles.directory(path) do |castle|
      Dir.chdir(castle) do
        system 'git init >/dev/null 2>&1'
        system 'git config user.email "test@test.com"'
        system 'git config user.name "Test Name"'
        system "git remote add origin git://github.com/technicalpickles/#{name}.git >/dev/null 2>&1"
        if subdirs
          subdir_file = castle.join(Homesick::SUBDIR_FILENAME)
          subdirs.each do |subdir|
            system "echo #{subdir} >> #{subdir_file}"
          end
        end
        return castle.directory('home')
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
homesick-0.9.8 spec/spec_helper.rb