Open wrozka opened 10 years ago
Let's assume that in the production code there is a constant defined like this:
UserValidator = Validator.new do # ... end
We want to be able to fake this object (copy it's entire interface):
fake(:user_validator, as: :object)
and we want to be able to replace the constant with a fake object that has the same exact interface:
fake_const(UserValidator)
Let's assume that in the production code there is a constant defined like this:
We want to be able to fake this object (copy it's entire interface):
and we want to be able to replace the constant with a fake object that has the same exact interface: