Sha256: b429bf687ad10763598277de3f155125437aa9416837eabd3f421180226b7fd8

Contents?: true

Size: 1.29 KB

Versions: 13

Compression:

Stored size: 1.29 KB

Contents

require 'spec_helper'

require 'pe_build/provisioner/pe_bootstrap'

describe PEBuild::Provisioner::PEBootstrap do
  include_context 'vagrant-unit'

  let(:test_env) do
    test_env = isolated_environment
    test_env.vagrantfile <<-EOF
Vagrant.configure('2') do |config|
  config.vm.define :test
end
EOF

    test_env
  end
  let(:env)              { test_env.create_vagrant_env }
  let(:machine)          { env.machine(:test, :dummy) }
  let(:bootstrap_config) { PEBuild::Config::PEBootstrap.new }

  # Mock the communicator to prevent SSH commands for being executed.
  let(:communicator)     { double('communicator') }
  # Mock the guest operating system.
  let(:guest)            { double('guest') }

  before (:each) do
    machine.stub(:guest => guest)
    machine.stub(:communicator => communicator)
  end

  after(:each) { test_env.close }

  subject(:provisioner) { described_class.new(machine, bootstrap_config) }


  describe 'when configured' do
    context 'and no version is set' do
      it 'raises an error' do
        pending 'This is now done in the `provision` method which is difficult to isolate for a test'
        expect { subject.configure(machine.config) }.to raise_error(
          PEBuild::Provisioner::PEBootstrap::UnsetVersionError,
          /version must be set/ )
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
vagrant-pe_build-0.10.4 spec/unit/provisioner/pe_bootstrap_spec.rb
vagrant-pe_build-0.10.3 spec/unit/provisioner/pe_bootstrap_spec.rb
vagrant-pe_build-0.10.2 spec/unit/provisioner/pe_bootstrap_spec.rb
vagrant-pe_build-0.10.1 spec/unit/provisioner/pe_bootstrap_spec.rb
vagrant-pe_build-0.10.0 spec/unit/provisioner/pe_bootstrap_spec.rb
vagrant-pe_build-0.9.7 spec/unit/provisioner/pe_bootstrap_spec.rb
vagrant-pe_build-0.9.6 spec/unit/provisioner/pe_bootstrap_spec.rb
vagrant-pe_build-0.9.5 spec/unit/provisioner/pe_bootstrap_spec.rb
vagrant-pe_build-0.9.4 spec/unit/provisioner/pe_bootstrap_spec.rb
vagrant-pe_build-0.9.3 spec/unit/provisioner/pe_bootstrap_spec.rb
vagrant-pe_build-0.9.2 spec/unit/provisioner/pe_bootstrap_spec.rb
vagrant-pe_build-0.9.1 spec/unit/provisioner/pe_bootstrap_spec.rb
vagrant-pe_build-0.9.0 spec/unit/provisioner/pe_bootstrap_spec.rb