Object
Provides information about constants that may (or may not) have been mutated by rspec-mocks.
@api private
# File lib/rspec/mocks/mutate_const.rb, line 84 def initialize(name) @name = name @previously_defined = false @stubbed = false @hidden = false end
Queries rspec-mocks to find out information about the named constant.
@param [String] name the name of the constant @return [Constant] an object contaning information about the named
constant.
# File lib/rspec/mocks/mutate_const.rb, line 148 def self.original(name) mutator = ConstantMutator.find(name) mutator ? mutator.to_constant : unmutated(name) end
@return [Boolean] Whether or not rspec-mocks has mutated
(stubbed or hidden) this constant.
# File lib/rspec/mocks/mutate_const.rb, line 110 def mutated? @stubbed || @hidden end
@return [Boolean] Whether or not the constant was defined
before the current example.
# File lib/rspec/mocks/mutate_const.rb, line 104 def previously_defined? @previously_defined end
@return [Boolean] Whether or not rspec-mocks has stubbed
this constant.
# File lib/rspec/mocks/mutate_const.rb, line 116 def stubbed? @stubbed end
# File lib/rspec/mocks/mutate_const.rb, line 126 def to_s "#<#{self.class.name} #{name}>" end
Generated with the Darkfish Rdoc Generator 2.