Sha256: 916e33ae62e83185ef05344c28f6acdf50728aa70eda8ad693c8976941d823d2

Contents?: true

Size: 859 Bytes

Versions: 1

Compression:

Stored size: 859 Bytes

Contents

# frozen_string_literal: true

require "much-stub"

module Assert
  def self.stubs
    MuchStub.stubs
  end

  def self.stub(*args, &block)
    MuchStub.stub(*args, &block)
  end

  def self.stub_on_call(*args, &block)
    MuchStub.stub_on_call(*args, &block)
  end

  def self.unstub(*args)
    MuchStub.unstub(*args)
  end

  def self.unstub!
    MuchStub.unstub!
  end

  def self.stub_send(*args, &block)
    orig_caller = caller_locations
    begin
      MuchStub.stub_send(*args, &block)
    rescue MuchStub::NotStubbedError => err
      err.set_backtrace(orig_caller.map(&:to_s))
      raise err
    end
  end

  def self.stub_tap(*args, &block)
    MuchStub.tap(*args, &block)
  end

  def self.stub_tap_on_call(*args, &block)
    MuchStub.tap_on_call(*args, &block)
  end

  def self.stub_spy(*args, &block)
    MuchStub.spy(*args, &block)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
assert-2.19.1 lib/assert/stub.rb