Sha256: 6179c73d0a31424139d71520300ce307923cd581941ea9b44b84e6e65ae29a67

Contents?: true

Size: 696 Bytes

Versions: 2

Compression:

Stored size: 696 Bytes

Contents

# frozen_string_literal: true

class BCDD::Result
  class Config
    module Features
      OPTIONS = {
        expectations: {
          default: true,
          affects: %w[BCDD::Result::Expectations BCDD::Result::Context::Expectations]
        },
        transitions: {
          default: true,
          affects: %w[BCDD::Result BCDD::Result::Context]
        }
      }.transform_values!(&:freeze).freeze

      Listener = ->(option_name, _bool) do
        Thread.current[Transitions::THREAD_VAR_NAME] = nil if option_name == :transitions
      end

      def self.switcher
        Switcher.new(options: OPTIONS, listener: Listener)
      end
    end

    private_constant :Features
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bcdd-result-0.11.0 lib/bcdd/result/config/switchers/features.rb
bcdd-result-0.10.0 lib/bcdd/result/config/switchers/features.rb