diff --git a/spec/tasks/vagrant_spec.rb b/spec/tasks/vagrant_spec.rb new file mode 100644 index 00000000..908885a0 --- /dev/null +++ b/spec/tasks/vagrant_spec.rb @@ -0,0 +1,28 @@ +require 'spec_helper' +require_relative '../../tasks/vagrant' + +describe 'vagrant' do + let(:platform) { 'generic/debian10' } + let(:inventory_location) { './spec/fixtures/litmus_inventory.yaml' } + let(:enable_synced_folder) { true } + let(:provider) { 'virtualbox' } + let(:cpus) { 2 } + let(:memory) { 2048 } + let(:hyperv_vswitch) { nil } + let(:hyperv_smb_username) { nil } + let(:hyperv_smb_password) { nil } + let(:box_url) { nil } + let(:password) { 'password' } + let(:vars) { 'role: worker1' } + + describe 'provision::vagrant' do + it 'provisions a new vagrant box' do + result = provision(platform, inventory_location, enable_synced_folder, provider, cpus, memory, hyperv_vswitch, hyperv_smb_username, hyperv_smb_password, box_url, password, vars) + expect(result[:status]).to eq('ok') + expect(result[:node_name]).not_to be_nil + expect(result[:node]['facts']['provisioner']).to eq('vagrant') + expect(result[:node]['facts']['platform']).to eq(platform) + # expect(result[:node]['vars']).to eq(JSON.parse(vars)) + end + end +end \ No newline at end of file