Trimming down Ruby snippet and replacing some of it with markup tests.