HomePhorge

(#7592) Remove redundant call to String#to_s
8c0d3ea6d45bUnpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(#7592) Remove redundant call to String#to_s

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.

Details

Provenance
Josh Cooper <josh@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU21be6e7e9127: Merge remote-tracking branch 'domcleal/tickets/master/7592'
Branches
Unknown
Tags
Unknown

Event Timeline

Josh Cooper <josh@puppetlabs.com> committed rPU8c0d3ea6d45b: (#7592) Remove redundant call to String#to_s (authored by Josh Cooper <josh@puppetlabs.com>).Dec 7 2011, 6:30 AM