Skip to content

Instantly share code, notes, and snippets.

View j16r's full-sized avatar
😑

John Barker j16r

😑
  • Colorado
View GitHub Profile

This is a quick sketch of how I think terminology applies to the various kinds of mocking and test doubles that apply in Go.

In practice, the most effective way to mock things in Go is to use an interface, and then to substitute a specialized testing implementation in place of a real one. Wherever a substitute is used, I think this should be called a "double".

There is one specialization of a "double" and that is a "fake" implementation. Fakes can often have real world uses, e.g: "RamDiskDatabase", but are typically

@j16r
j16r / Wordler
Created February 24, 2022 12:42
#!/usr/bin/env ruby
require 'date'
day = (Date.today - Date.civil(2021, 6, 19)).to_i
won = rand(5)+1
puts "Wordle #{day} #{won}/6"
tiles = ['🟩','🟨','⬛️']
(1..won-1).each do |row|