Sha256: c7dfee75435fe46bf70790bf7d0cfa4b4a68f75692c585fd03cd54e13461d7ce

Contents?: true

Size: 688 Bytes

Versions: 1

Compression:

Stored size: 688 Bytes

Contents

require 'simplecov'

require 'rspec'
require 'figgy'
require 'heredoc_unindent'

module Figgy::SpecHelpers
  def current_dir
    File.join(Dir.getwd, 'tmp')
  end

  def test_config
    Figgy.build do |config|
      config.root = current_dir
      yield config if block_given?
    end
  end

  def write_config(filename, contents)
    filename = "#{filename}.yml" unless filename =~ /\./
    full_filename = File.join(current_dir, filename)

    FileUtils.mkdir_p(File.dirname(full_filename))

    file = File.new(full_filename, "w+")
    file.write(contents)
    file.close
  end
end

RSpec.configure do |c|
  c.include Figgy::SpecHelpers

  c.after { FileUtils.rm_rf(current_dir) }
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
figgy-1.3.0 spec/spec_helper.rb