Skip to content

Instantly share code, notes, and snippets.

@elle
elle / 2015-poodnyc-notes.md
Last active September 12, 2021 11:05
Notes from Poodnyc 2015 workshop

Rules for Horizontal Refactoring

  • If you go red, undo
  • Only change one line at a time
  1. Find two strings that are the most alike
  2. Find the smallest difference
  3. Make the smallest change that make the tests pass

How to make a small change

I highly suspect that the RSpec core team all use black backgrounds in their terminals because sometimes the colors aren’t so nice on my white terminal

I certainly use a black background. I'm not sure about the other RSpec core folks. Regardless, if there are some color changes we can make that would make output look good on a larger variety of backgrounds, we'll certainly consider that (do you have some suggested changes?). In the meantime, the colors are configurable, so you can change the colors to fit your preferences on your machine. First, create a file at

namespace :load do
ZIP_CODE_DATA_URL = 'http://www.census.gov/tiger/tms/gazetteer/zips.txt'
# Swiped from ActiveRecord migrations.rb
def announce(message)
length = [0, 75 - message.length].max
puts "== %s %s" % [message, "=" * length]
end