123456789_123456789_123456789_123456789_123456789_

Class: RSpec::Mocks::ConstantMutator::BaseMutator Private

Do not use. This class is for internal use only.
Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Subclasses:
RSpec::Mocks::ConstantMutator::ConstantHider, RSpec::Mocks::ConstantMutator::DefinedConstantReplacer, RSpec::Mocks::ConstantMutator::UndefinedConstantSetter
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
Inherits: Object
Defined in: rspec-mocks/lib/rspec/mocks/mutate_const.rb

Overview

Contains common functionality used by all of the constant mutators.

Class Method Summary

Instance Attribute Summary

Instance Method Summary

::RSpec::Support::RecursiveConstMethods - Included

#const_defined_on?

See additional method definition at line 31.

#constants_defined_on

See additional method definition at line 41.

#get_const_defined_on

See additional method definition at line 35.

#normalize_const_name, #recursive_const_defined?, #recursive_const_get

Instance Attribute Details

#full_constant_name (readonly)

[ GitHub ]

  
# File 'rspec-mocks/lib/rspec/mocks/mutate_const.rb', line 142

attr_reader :original_value, :full_constant_name

#original_value (readonly)

[ GitHub ]

  
# File 'rspec-mocks/lib/rspec/mocks/mutate_const.rb', line 142

attr_reader :original_value, :full_constant_name

Instance Method Details

#idempotently_reset

[ GitHub ]

  
# File 'rspec-mocks/lib/rspec/mocks/mutate_const.rb', line 160

def idempotently_reset
  reset unless @reset_performed
  @reset_performed = true
end

#to_constant

[ GitHub ]

  
# File 'rspec-mocks/lib/rspec/mocks/mutate_const.rb', line 153

def to_constant
  const = Constant.new(full_constant_name)
  const.original_value = original_value

  const
end