0

I'm working a project that uses a notify method that does does not belong to a method. I want to stub this method to help speed up my spec and keep my log clean. How can i do this?

lib/notify.rb

require 'json'
require 'rest-client'

def notify(*params)
  ...
end
Antarr Byrd
  • 24,863
  • 33
  • 100
  • 188

1 Answers1

1

Use a before block in your specs to stub the :notify method on subject:

before do
  allow(subject).to receive(:notify)
end
infused
  • 24,000
  • 13
  • 68
  • 78