Modernize selector_spec, add Ruby 1.9.2 support, with bonus bugfix.
The spec was wildly out of date, and did horrible things with stubs and
instance variables. Instead, lets rewrite to use nice let methods, helper
functions, and a modern approach without stubbing the world.
This sets the stage for the relatively minor changes needed to support 1.9.2
in this particular area of the tests.
Finally, actually *testing* the code turned up a cosmetic bug in the string
output code: if you only had a single match value, which pretty much never
happens, you would represent it as:
... ? { "match", "value" }
The correct output, now implemented in a nasty, inefficient way, is:
... ? { "match" => "value" }
Signed-off-by: Daniel Pittman <daniel@puppetlabs.com>