Skip to content

Instantly share code, notes, and snippets.

@JoshTGreenwood
JoshTGreenwood / testdouble.rb
Created October 18, 2016 15:46
the beginning of what testdouble.rb might look like
class TestDouble
attr_accessor :instance, :when_stack
def initialize(instance)
@instance = instance
@when_stack = []
end
def when(&block)
fake_method_call = FakeMethodCall.new(block)
;; -*- mode: dotspacemacs -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration."
(setq-default
;; List of additional paths where to look for configuration layers.
;; Paths must have a trailing slash (ie. `~/.mycontribs/')
dotspacemacs-configuration-layer-path '()
@JoshTGreenwood
JoshTGreenwood / bench.rb
Created November 21, 2012 00:14
Benchmark break vs. catch-throw vs. begin-rescue-end in ruby
require 'benchmark'
Benchmark.bmbm do |x|
x.report('Break') do
1_000_000.times do
break
end
end