Write tests. They'll save your ass.
If it's happened more than twice, don't ever do it by hand again.
| # 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) |
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'httparty' | |
| require 'radar_love' | |
| require 'pp' | |
| require 'yaml' | |
| class TopEntities | |
| include HTTParty |