puppetlabs/puppet — pull request #552 by nicklewis (2012-03-02 21:48:28+00:00)
Title: Ticket/2.7.x/11988 Augeas spec fixes on Ruby 1.9

Previously, the augeas provider made calls like the following:

@aug.get(key).to_s

Since the Augeas#get method returns a String not an array, the to_s
call is redundant. (Note the #match method does return an array.)

The augeas tests were stubbing the #get method to return an array in
some places (and a string in others). Prior to 1.9.2, ruby will
automatically convert ["foo"].to_s to "foo", so everything worked as
expected. However, under 1.9.2, ["foo"].to_s becomes "[\"foo\"]".

These failures weren't noticed earlier, because our 1.9.2@allFeatures
jenkins nodes do not have ruby-augeas installed. In other words, tests
that require Puppet.features.augeas? were never running in
Jenkins. The recent change to improve augeas testing, removed the
dependency on this feature being installed, so these tests started
failing.

This commit just removes the redundant call to String#to_s, and
updates the spec tests to match what the Augeas#get method really
returns.