Parent

Class/Module Index [+]

Quicksearch

RSpec::Mocks::Constant

Provides information about constants that may (or may not) have been mutated by rspec-mocks.

Attributes

hidden[W]

@api private

name[R]

@return [String] The fully qualified name of the constant.

original_value[RW]

@return [Object, nil] The original value (e.g. before it

was mutated by rspec-mocks) of the constant, or
nil if the constant was not previously defined.
previously_defined[W]

@api private

stubbed[W]

@api private

Public Class Methods

new(name) click to toggle source

@api private

# File lib/rspec/mocks/mutate_const.rb, line 84
def initialize(name)
  @name = name
end
original(name) click to toggle source

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 145
def self.original(name)
  mutator = ConstantMutator.find(name)
  mutator ? mutator.to_constant : unmutated(name)
end

Public Instance Methods

hidden?() click to toggle source

@return [Boolean] Whether or not rspec-mocks has hidden

this constant.
# File lib/rspec/mocks/mutate_const.rb, line 119
def hidden?
  @hidden
end
inspect() click to toggle source
Alias for: to_s
mutated?() click to toggle source

@return [Boolean] Whether or not rspec-mocks has mutated

(stubbed or hidden) this constant.
# File lib/rspec/mocks/mutate_const.rb, line 107
def mutated?
  @stubbed || @hidden
end
previously_defined?() click to toggle source

@return [Boolean] Whether or not the constant was defined

before the current example.
# File lib/rspec/mocks/mutate_const.rb, line 101
def previously_defined?
  @previously_defined
end
stubbed?() click to toggle source

@return [Boolean] Whether or not rspec-mocks has stubbed

this constant.
# File lib/rspec/mocks/mutate_const.rb, line 113
def stubbed?
  @stubbed
end
to_s() click to toggle source
# File lib/rspec/mocks/mutate_const.rb, line 123
def to_s
  "#<#{self.class.name} #{name}>"
end
Also aliased as: inspect

[Validate]

Generated with the Darkfish Rdoc Generator 2.