Module: Flipper::TestHelp

Extended by:
TestHelp
Included in:
TestHelp
Defined in:
lib/flipper/test_help.rb

Instance Method Summary collapse

Instance Method Details

#flipper_configureObject



5
6
7
8
9
10
11
12
13
14
# File 'lib/flipper/test_help.rb', line 5

def flipper_configure
  # Use a shared Memory adapter for all tests. This is instantiated outside of the
  # `configure` block so the same instance is returned in new threads.
  adapter = Flipper::Adapters::Memory.new

  Flipper.configure do |config|
    config.adapter { adapter }
    config.default { Flipper.new(config.adapter) }
  end
end

#flipper_resetObject



16
17
18
19
20
21
22
# File 'lib/flipper/test_help.rb', line 16

def flipper_reset
  # Remove all features
  Flipper.features.each(&:remove) rescue nil

  # Reset previous DSL instance
  Flipper.instance = nil
end