Sha256: 28045b25160a239a66a9ffcb82fd6635f8e6122510d096ececddde4b0ddccfde

Contents?: true

Size: 858 Bytes

Versions: 1

Compression:

Stored size: 858 Bytes

Contents

require 'bundler/setup'
require 'rails'
require 'simple_switch'

Bundler.setup

RSpec.configure do |config|
  config.expect_with(:rspec) { |c| c.syntax = :expect }
  config.order = :random

  config.before :each do
    # reset feature_config.yml
    File.open('spec/config/feature_config.yml', 'w') do |f|
      init_hash = HashWithIndifferentAccess.new(
        {
          foo: {
            development: true,
            test:        true,
            production:  false
          },
          bar: {
            development: true,
            test:        false,
            production:  true
          }
        }
      )

      f.puts init_hash.to_hash.to_yaml
    end

    allow_any_instance_of(SimpleSwitch::Switch).to receive(:file_path).and_return('spec/config/feature_config.yml')
    SimpleSwitch.feature_manager.send(:reload_config!)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
simple_switch-0.2.0 spec/spec_helper.rb