Sha256: e8c658d9166af144425c09b1cf5722c04e17b8fcdd5eeaa4bf07e2009eedb34a

Contents?: true

Size: 1.13 KB

Versions: 2

Compression:

Stored size: 1.13 KB

Contents

# This file was generated by the `rspec --init` command. Conventionally, all
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
# Require this file using `require "spec_helper"` to ensure that it is only
# loaded once.
#
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
require_relative "../lib/octopolo"
Octopolo.instance_variable_set(:@config, Octopolo::Config.new({:deploy_branch => "master"}))

RSpec.configure do |config|
  config.treat_symbols_as_metadata_keys_with_true_values = true
  config.run_all_when_everything_filtered = true
  config.filter_run :focus

  # environment restoration lifted from facter project
  # https://github.com/puppetlabs/facter/commit/6e29ff7165b8bb63d1deeff6502a0195fa3974e5
  config.before :each do
    # Store any environment variables away to be restored later
    @old_env = {}
    ENV.each_key {|k| @old_env[k] = ENV[k]}
  end

  config.after :each do
    # Restore environment variables after execution of each test
    @old_env.each_pair {|k, v| ENV[k] = v}
    to_remove = ENV.keys.reject {|key| @old_env.include? key }
    to_remove.each {|key| ENV.delete key }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
octopolo-0.0.2 spec/spec_helper.rb
octopolo-0.0.1 spec/spec_helper.rb