Method: RSpec::Mocks::ExampleMethods#stub_const
- Defined in:
- lib/rspec/mocks/example_methods.rb
#stub_const(constant_name, value, options = {}) ⇒ Object
Stubs the named constant with the given value. Like method stubs, the constant will be restored to its original value (or lack of one, if it was undefined) when the example completes.
241 242 243 |
# File 'lib/rspec/mocks/example_methods.rb', line 241 def stub_const(constant_name, value, ={}) ConstantMutator.stub(constant_name, value, ) end |