Seth Vargo Ruby, Chef, Rants and Pants Ruby Testing Unit Testing Correctly Posted on January 12, 2013 . Featured Ruby Testing Unit Testing Correctly Posted on January 12, 2013 . Let's talk about testing. Testing is fun, it's awesome, and if you want to be agile, it's a necessity. But chances are, you're doing it wrong. Before we dive into Chef, let's look at a small Ruby example. Consider a class writes a downloads an HTML page from a website and writes the contents to a file: require 'net/http' class Scraper attr_reader :webpage def initialize ( webpage = 'http://sethvargo.com' ) @webpage = URI . parse ( webpage ) write Net :: HTTP . get ( @webpage ) end def write ( contents ) File . open ( " #{ @webpage . host } .html" , 'w' ) do | file | file . write ( contents ) end end end Scraper . new This class should download s...