setup/gem/010_GemInstall.rb in beaker-puppet-1.29.0 vs setup/gem/010_GemInstall.rb in beaker-puppet-2.0.0
- old
+ new
@@ -1,18 +1,19 @@
-test_name "Install puppet gem"
+test_name 'Install puppet gem'
agents.each do |agent|
- sha = ENV['SHA']
+ sha = ENV.fetch('SHA', nil)
base_url = "http://builds.delivery.puppetlabs.net/puppet/#{sha}/artifacts"
ruby_command = ruby_command(agent)
gem_command = gem_command(agent)
# retrieve the build data, since the gem version is based on the short git
# describe, not the full git SHA
on(agent, "curl -s -o build_data.yaml #{base_url}/#{sha}.yaml")
- gem_version = on(agent, "#{ruby_command} -ryaml -e 'puts YAML.load_file(\"build_data.yaml\")[:gemversion]'").stdout.chomp
+ gem_version = on(agent,
+ "#{ruby_command} -ryaml -e 'puts YAML.load_file(\"build_data.yaml\")[:gemversion]'").stdout.chomp
if agent['platform'] =~ /windows/
# wipe existing gems first
default_dir = on(agent, "#{ruby_command} -rrbconfig -e 'puts Gem.default_dir'").stdout.chomp
on(agent, "rm -rf '#{default_dir}'")
@@ -25,10 +26,10 @@
end
step "Download puppet gem from #{url}"
on(agent, "curl -s -o puppet.gem #{url}")
- step "Install puppet.gem"
+ step 'Install puppet.gem'
on(agent, "#{gem_command} install puppet.gem")
step "Verify it's sane"
on(agent, puppet('--version'))
on(agent, puppet('apply', "-e \"notify { 'hello': }\"")) do |result|