require "codeclimate-test-reporter"
CodeClimate::TestReporter.start

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'togls'

require 'pry'

RSpec.configure do |c|
  c.disable_monkey_patching!
  c.order = :random

  c.before(:each) do
    Togls.instance_variable_set(:@release_toggle_registry, nil)
    Togls.instance_variable_set(:@feature_repository, nil)
    Togls.instance_variable_set(:@rule_type_repository, nil)
    Togls.instance_variable_set(:@rule_type_registry, nil)
  end

  c.around(:each) do |example|
    save_default_feature_target_type = Togls.default_feature_target_type
    # Togls.instance_variable_set(:@default_feature_target_type, :test_target_type)
    Togls.instance_variable_set(:@default_feature_target_type, nil)
    example.run
    Togls.instance_variable_set(:@default_feature_target_type, save_default_feature_target_type)
  end
end

require "codeclimate-test-reporter"
CodeClimate::TestReporter.start

$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'togls'

require 'pry'

RSpec.configure do |c|
  c.disable_monkey_patching!
  c.order = :random
  c.mock_with :rspec do |mocks|
    mocks.verify_partial_doubles = true
  end

  c.before(:each) do
    Togls.instance_variable_set(:@release_toggle_registry, nil)
    Togls.instance_variable_set(:@feature_repository, nil)
    Togls.instance_variable_set(:@rule_type_repository, nil)
    Togls.instance_variable_set(:@rule_type_registry, nil)
  end

  c.around(:each) do |example|
    save_default_feature_target_type = Togls.default_feature_target_type
    # Togls.instance_variable_set(:@default_feature_target_type, :test_target_type)
    Togls.instance_variable_set(:@default_feature_target_type, nil)
    example.run
    Togls.instance_variable_set(:@default_feature_target_type, save_default_feature_target_type)
  end
end

Add verify partial doubles to spec helper
Add verify partial doubles to spec helper

I did this so that we have an easier time driving out or tests when we are
creating doubles and mocks that don't exist yet.
