| Class | RSpec::Mocks::ConstantMutator |
| In: |
lib/rspec/mocks/mutate_const.rb
|
| Parent: | Object |
Provides a means to stub constants.
Hides a constant.
@param (see ExampleMethods#hide_const)
@see ExampleMethods#hide_const @note It‘s recommended that you use `hide_const` in your
examples. This is an alternate public API that is provided so you can hide constants in other contexts (e.g. helper classes).
Used internally by the constant stubbing to raise a helpful error when a constant like "A::B::C" is stubbed and A::B is not a module (and thus, it‘s impossible to define "A::B::C" since only modules can have nested constants).
@api private
Resets all stubbed constants. This is called automatically by rspec-mocks when an example finishes.
@api private
Stubs a constant.
@param (see ExampleMethods#stub_const) @option (see ExampleMethods#stub_const) @return (see ExampleMethods#stub_const)
@see ExampleMethods#stub_const @note It‘s recommended that you use `stub_const` in your
examples. This is an alternate public API that is provided so you can stub constants in other contexts (e.g. helper classes).