Sha256: ca6fc83320aa68fde3ca352cb26a88cc4999a3013a8d29760369009cc7e37c57

Contents?: true

Size: 368 Bytes

Versions: 40

Compression:

Stored size: 368 Bytes

Contents

module DefinesConstants
  def self.included(base)
    base.before(:each) do
      @defined_constants = []
    end

    base.after(:each) do
      @defined_constants.each do |constant|
        Object.__send__(:remove_const, constant)
      end
    end
  end

  def define_constant(name, value)
    Object.const_set(name, value)
    @defined_constants << name
  end
end

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
honeybadger-1.16.7 spec/support/defines_constants.rb
honeybadger-1.16.6 spec/support/defines_constants.rb
honeybadger-1.16.5 spec/support/defines_constants.rb
honeybadger-1.16.4 spec/support/defines_constants.rb
honeybadger-1.16.3 spec/support/defines_constants.rb
honeybadger-1.16.2 spec/support/defines_constants.rb
honeybadger-1.16.1 spec/support/defines_constants.rb
honeybadger-1.16.0 spec/support/defines_constants.rb
honeybadger-1.15.3 spec/support/defines_constants.rb
honeybadger-1.15.2 spec/support/defines_constants.rb
honeybadger-1.15.1 spec/support/defines_constants.rb
honeybadger-1.15.0 spec/support/defines_constants.rb
honeybadger-1.14.0 spec/support/defines_constants.rb
honeybadger-1.13.2 spec/support/defines_constants.rb
honeybadger-1.13.1 spec/support/defines_constants.rb
honeybadger-1.13.0 spec/support/defines_constants.rb
honeybadger-1.12.0.beta3 spec/support/defines_constants.rb
honeybadger-1.12.0.beta2 spec/support/defines_constants.rb
honeybadger-1.11.2 spec/support/defines_constants.rb
honeybadger-1.11.1 spec/support/defines_constants.rb