(PDOC-2) Refactor tests for 4x function handler

Update the spec tests which cover the Puppet 4x function handler
to be more specific and cover different test cases. Prior to this commit,
they would simply check that the right objects had been added to the
Registry for one example. Now, they examine multiple examples and ensure that
the code objects not only exist but that the details about them are what we
would expect for each specific scenario.