Ruby 1.8.5 compatibility changes in tests and code.
A handful of methods, like Array#count and String#start_with? don't exist in
older versions of Ruby, and have sufficiently complex semantics that
rebuilding them seems less than worthwhile.
This rewrites the small points of code to avoid those methods, retaining
compatibility with 1.8.5 and 1.8.6 across the board.
Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>