Module: GitReflow::RSpec::StubHelpers

Defined in:
lib/git_reflow/rspec/stub_helpers.rb

Instance Method Summary collapse

Instance Method Details

#stub_with_fallback(obj, method) ⇒ Object



5
6
7
8
9
# File 'lib/git_reflow/rspec/stub_helpers.rb', line 5

def stub_with_fallback(obj, method)
  original_method = obj.method(method)
  allow(obj).to receive(method).with(anything()) { |*args| original_method.call(*args) }
  return allow(obj).to receive(method)
end