Sha256: dd711e7e68a13d3edcd2f2b4bd7c5006afae32dd1f5d4d5787e47d7fd8f10997

Contents?: true

Size: 1.47 KB

Versions: 10

Compression:

Stored size: 1.47 KB

Contents

shared_examples 'provider/provisioner/pe_build' do |provider, options|
  if !File.file?(options[:box])
    raise ArgumentError,
      "A box file must be downloaded for provider: #{provider}. Try: rake acceptance:setup"
  end

  include_context 'acceptance'

  before(:each) do
    environment.skeleton('pe_build')
    assert_execute('vagrant', 'box', 'add', 'box', options[:box])
  end

  after(:each) do
    # Ensure any VMs that survived tests are cleaned up.
    assert_execute('vagrant', 'destroy', '--force', log: false)
  end

  context 'when download_root is set to a local directory' do
    let(:extra_env) do
      vars = options[:env_vars].dup
      vars['PE_BUILD_DOWNLOAD_ROOT'] = options[:archive_path]

      vars
    end

    it 'provisions with pe_build' do
      assert_execute('vagrant', 'up', "--provider=#{provider}", 'explicit-version')
      assert_execute('vagrant', 'up', "--provider=#{provider}", 'latest-version')
    end
  end

  context 'when download_root is set to a webserver' do
    let(:webserver_port) { 3838 }
    let(:webserver_path) { options[:archive_path] }
    include_context 'webserver'

    let(:extra_env) do
      vars = options[:env_vars].dup
      vars['PE_BUILD_DOWNLOAD_ROOT'] = "http://localhost:#{webserver_port}/"

      vars
    end

    it 'provisions with pe_build' do
      assert_execute('vagrant', 'up', "--provider=#{provider}", 'explicit-version')
      assert_execute('vagrant', 'up', "--provider=#{provider}", 'latest-version')
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
vagrant-pe_build-0.10.1 acceptance/pe_build/pe_build_spec.rb
vagrant-pe_build-0.10.0 acceptance/pe_build/pe_build_spec.rb
vagrant-pe_build-0.9.7 acceptance/pe_build/pe_build_spec.rb
vagrant-pe_build-0.9.6 acceptance/pe_build/pe_build_spec.rb
vagrant-pe_build-0.9.5 acceptance/pe_build/pe_build_spec.rb
vagrant-pe_build-0.9.4 acceptance/pe_build/pe_build_spec.rb
vagrant-pe_build-0.9.3 acceptance/pe_build/pe_build_spec.rb
vagrant-pe_build-0.9.2 acceptance/pe_build/pe_build_spec.rb
vagrant-pe_build-0.9.1 acceptance/pe_build/pe_build_spec.rb
vagrant-pe_build-0.9.0 acceptance/pe_build/pe_build_spec.rb