Sha256: 38a63d4485b2b76dc60211ee1cdc4627630aeb1d4e30ddec31d7813d882d8bc2

Contents?: true

Size: 1019 Bytes

Versions: 11

Compression:

Stored size: 1019 Bytes

Contents

require 'blazing'

ENV['PATH'] = "#{File.expand_path(File.dirname(__FILE__) + '/../../bin')}#{File::PATH_SEPARATOR}#{ENV['PATH']}"

#
# Stuff borrowed from carlhuda/bundler
#
RSpec.configure do |config|
  def capture(stream)
    begin
      stream = stream.to_s
      eval "$#{stream} = StringIO.new"
      yield
      result = eval("$#{stream}").string
    ensure
      eval("$#{stream} = #{stream.upcase}")
    end

    result
  end

  def setup_sandbox
    @blazing_root = Dir.pwd
    @sandbox_directory = File.join('/tmp/blazing_sandbox')

    # Sometimes, when specs failed, the sandbox would stick around
    FileUtils.rm_rf(@sandbox_directory) if File.exists?(@sandbox_directory)

    # Setup Sandbox and cd into it
    Dir.mkdir(@sandbox_directory)
    Dir.chdir(@sandbox_directory)
    `git init .`
  end

  def teardown_sandbox
    # Teardown Sandbox
    Dir.chdir(@blazing_root)
    FileUtils.rm_rf(@sandbox_directory)
  end

  def destination_root
    File.join(File.dirname(__FILE__), 'sandbox')
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
blazing-0.2.1 spec/spec_helper.rb
blazing-0.2.0 spec/spec_helper.rb
blazing-0.1.3 spec/spec_helper.rb
blazing-0.1.2 spec/spec_helper.rb
blazing-0.1.1 spec/spec_helper.rb
blazing-0.1.0 spec/spec_helper.rb
blazing-0.1.0.alpha6 spec/spec_helper.rb
blazing-0.1.0.alpha5 spec/spec_helper.rb
blazing-0.1.0.alpha4 spec/spec_helper.rb
blazing-0.1.0.alpha3 spec/spec_helper.rb
blazing-0.1.0.alpha2 spec/spec_helper.rb