Skip to content

Instantly share code, notes, and snippets.

View corywheeler's full-sized avatar

Cory Wheeler corywheeler

View GitHub Profile
@corywheeler
corywheeler / TestHelper.cs
Created February 17, 2019 04:13 — forked from haacked/TestHelper.cs
String Comparison Unit Test Helper
public static class TestHelpers
{
public static void ShouldEqualWithDiff(this string actualValue, string expectedValue)
{
ShouldEqualWithDiff(actualValue, expectedValue, DiffStyle.Full, Console.Out);
}
public static void ShouldEqualWithDiff(this string actualValue, string expectedValue, DiffStyle diffStyle)
{
ShouldEqualWithDiff(actualValue, expectedValue, diffStyle, Console.Out);
@corywheeler
corywheeler / zom.rb
Created January 13, 2017 14:41 — forked from michaelfeathers/zom.rb
Find the number of calls in Ruby code that have happened no times, just once, or many times.
require 'set'
require 'find'
require 'ap'
class Array
def to_h; Hash[self]; end
def to_s; Set.new(self); end
def freq; group_by {|e| e }.map {|k,v| [k,v.count] }.to_h; end
end