spec/shared/mock.rb
# Use the mock implementation inside a block and then restore the original implementation.
Use the mock implementation inside a block and then restore the original implementation.
Use the mock implementation inside a block and then restore the original implementation .
def use
        if object_space
          yield
        else
          setup
          begin
            yield
          ensure
            cleanup
          end
        end
      end
def use if object_space yield else setup begin yield ensure cleanup end end end
Use the mock implementation inside a block and then restore the original implementation.
Use the mock implementation inside a block and then restore the original implementation .