Sha256: 91a4704e94f685f40c24bc611025d6aac8ed539bf048ac1b5851ae1b048f9d0f

Contents?: true

Size: 325 Bytes

Versions: 7

Compression:

Stored size: 325 Bytes

Contents

# frozen_string_literal: true

module Unreliable
  class Config
    def self.setup!
      @enabled = true
    end

    def self.enabled?
      @enabled && Rails.env.test?
    end

    def self.disable
      prev_enabled = @enabled
      @enabled = false
      yield
    ensure
      @enabled = prev_enabled
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
unreliable-0.10.0 lib/unreliable/config.rb
unreliable-0.9.1 lib/unreliable/config.rb
unreliable-0.9.0 lib/unreliable/config.rb
unreliable-0.1.3 lib/unreliable/config.rb
unreliable-0.1.2 lib/unreliable/config.rb
unreliable-0.1.1 lib/unreliable/config.rb
unreliable-0.1.0 lib/unreliable/config.rb