Skip to content

Instantly share code, notes, and snippets.

View alexvollmer's full-sized avatar

Alex Vollmer alexvollmer

View GitHub Profile
# SOLUTION: just use the StringIO class and replace Kernel#rand with a fixture method. We're
# not interested in testing how rand works so explicitly setting the value is fine.
class Quiz
def initialize(input = STDIN, output = STDOUT)
@input = input
@output = output
end
def problem
first = rand(10)

Test It

Write tests. They'll save your ass.

Automate It

If it's happened more than twice, don't ever do it by hand again.

Queue It

#!/usr/bin/env ruby
require 'rubygems'
require 'httparty'
require 'radar_love'
require 'pp'
require 'yaml'
class TopEntities
include HTTParty