begin
  gem 'minitest-mock'
  spec = Gem::Specification.find_by_name('minitest-mock')
  real_path = File.join(spec.gem_dir, 'lib', 'minitest', 'mock.rb')
  load real_path
rescue Gem::LoadError
  raise LoadError, "cannot load such file -- minitest/mock (ruby-minitest-mock not installed)"
end
