puppetlabs/puppet-acceptance — pull request #432 by jeffmccune (2013-04-30 23:32:40+00:00)
Title: (maint) Fix LoadError with --helper in 1.9.3

Without this patch using a command line invocation like the following with MRI
1.9.3 causes an unhandled LoadError.

$ bundle exec ./systest.rb \
--config config/nodes/foss-new-${platform:-precise}.cfg \
--facter origin/master \ --hiera origin/master \
--type git \
--root-keys \
--no-color \
--xml \
--debug \
--helper acceptance-tests/lib/helper.rb \
--keyfile="${HOME}/.ssh/id_rsa-old.private" \
--install git://github.com/jeffmccune/puppet.git\#${GIT_BRANCH:-origin/stable_precise_acceptance} \
--preserve-hosts \
--no-ntp \
--tests acceptance-tests/**/ticket_6928_puppet_master_parse_fails.rb
cli.rb:17:in `require': cannot load such file -- acceptance-tests/lib/helper.rb (LoadError)
from /workspace/serious/src/puppet-acceptance/lib/puppet_acceptance/cli.rb:17:in `initialize'
from ./systest.rb:19:in `new'
from ./systest.rb:19:in `

'

This problem is caused by `systest.rb` making the assumption that "." is
in the `$LOAD_PATH`. While true in MRI 1.8, this is no longer true in
MRI 1.9.

This patch addresses the problem by catching the LoadError and adding
the top level directory of the puppet-acceptance project to the ruby
`$LOAD_PATH`.