Sha256: 23960585ec6fab13d1bf64498fcda39184125cbb11804fb0d871c95342a9e9b2

Contents?: true

Size: 1013 Bytes

Versions: 3

Compression:

Stored size: 1013 Bytes

Contents

# Encoding: utf-8
require 'spec_helper'

RSpec.describe Packer::Builder::Qemu do
  let(:builder) { Packer::Builder.get_builder(Packer::Builder::QEMU) }
  let(:in_commands_mixed)    { [["command1",  1], ["command2",  2]] }
  let(:out_commands_strings) { [["command1", "1"], ["command2", "2"]] }

  it 'has a type of qemu' do
    expect(builder.data['type']).to eq(Packer::Builder::QEMU)
  end

  it 'requires iso_checksum, iso_checksum_type, iso_url, and communicator' do
    expect { builder.validate }.to raise_error(Packer::DataObject::DataValidationError)
    builder.iso_checksum '88197272b2a442402820fcc788a8cc7a'
    builder.iso_checksum_type "MD5"
    builder.iso_url 'path'
    builder.communicator 'ssh'
    expect { builder.validate }.not_to raise_error
  end

  describe '#qemuargs' do
    it 'builds an array of arrays of strings' do
      builder.qemuargs(in_commands_mixed)
      expect( builder.data['qemuargs'] ).to eq(out_commands_strings)
      builder.data.delete('qemuargs')
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
packer-config-1.6.5 spec/packer/builders/qemu_spec.rb
packer-config-1.6.4 spec/packer/builders/qemu_spec.rb
packer-config-1.6.3 spec/packer/builders/qemu_spec.rb