Sha256: ed0b086282d172d341858e38e2e6a501cfdebda86ffbc45f34e81b56c50d2ea6

Contents?: true

Size: 1.15 KB

Versions: 14

Compression:

Stored size: 1.15 KB

Contents

require 'rspec-system/spec_helper'
require 'rspec-system-serverspec/helpers'

require 'system/system-helpers'

require 'system-provisioning/el'

require 'rspec-system-r10k/tmpdir'
require 'rspec-system-r10k/puppetfile'

RSpec.configure do |c|

  include SystemProvisioning::EL

  def install_deps
    install_epel_release
    install_puppetlabs_release

    yum_install %w[ruby rubygems]
    yum_install %w[puppet]
  end

  def build_artifact
    require 'r10k/version'

    desc = %x{git describe}.chomp
    artifact_name = "r10k-#{desc}.gem"

    system('gem build r10k.gemspec')
    FileUtils.mv "r10k-#{R10K::VERSION}.gem", artifact_name

    artifact_name
  end

  def upload_artifact(name)
    rcp :sp => "./#{name}", :dp => '/root'
    FileUtils.rm name
  end

  def install_artifact(name)
    shell "gem install --no-rdoc --no-ri /root/#{name}"
    shell "rm /root/#{name}"
  end

  def purge_gems
    shell 'gem list | cut -d" " -f1 | xargs gem uninstall -aIx'
  end

  def purge_r10k
    shell 'gem uninstall -aIx r10k'
  end

  c.before(:suite) do
    purge_r10k
    install_deps
    name = build_artifact
    upload_artifact(name)
    install_artifact(name)
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
r10k-1.3.5 spec/system/spec_helper.rb
r10k-1.3.4 spec/system/spec_helper.rb
r10k-1.2.4 spec/system/spec_helper.rb
r10k-1.3.3 spec/system/spec_helper.rb
r10k-1.3.2 spec/system/spec_helper.rb
r10k-1.2.3 spec/system/spec_helper.rb
r10k-1.3.1 spec/system/spec_helper.rb
r10k-1.2.2 spec/system/spec_helper.rb
r10k-1.3.0 spec/system/spec_helper.rb
r10k-1.3.0rc1 spec/system/spec_helper.rb
r10k-1.2.1 spec/system/spec_helper.rb
r10k-1.2.0 spec/system/spec_helper.rb
r10k-1.2.0rc2 spec/system/spec_helper.rb
r10k-1.2.0rc1 spec/system/spec_helper.rb