class Rogue::Support::MockMethods::MockContext

A Mock context allows us to code the mock expectations AFTER the tested method

Public Class Methods

new(block) click to toggle source
# File lib/rogue/support/mock_methods.rb, line 23
def initialize(block)
  @block = block
  @mock = ::Minitest::Mock.new
end

Public Instance Methods

verify_the_mock(&verify_block) click to toggle source
# File lib/rogue/support/mock_methods.rb, line 28
def verify_the_mock(&verify_block)
  verify_block&.call(@mock)
  @block.call(@mock)
  @mock.verify
end