Искал документы Relish, но не нашел способ развёртывания в RSpec.
Возможно ли это?
Ответ 1
rspec-mock указывает, что вы можете вызвать метод unstub. Я цитирую:
# Removes a stub. On a double, the object will no longer respond to
# `message`. On a real object, the original method (if it exists) is
# restored.
#
# This is rarely used, but can be useful when a stub is set up during a
# shared `before` hook for the common case, but you want to replace it
# for a special case.
def unstub(message)
::RSpec::Mocks.space.proxy_for(self).remove_stub(message)
end
Ответ 2
С новым синтаксисом expectunstub устарел. Вы можете сделать: