Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbreen28 committed May 15, 2024
1 parent 2b89d5a commit dcdde29
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions spec/tasks/vagrant_spec.rb
Original file line number Diff line number Diff line change
@@ -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]).to_not be_nil

Check failure on line 22 in spec/tasks/vagrant_spec.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 7.24, Ruby Ver: 2.7)

RSpec/NotToNot: Prefer `not_to` over `to_not`. (https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NotToNot)

Check failure on line 22 in spec/tasks/vagrant_spec.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

RSpec/NotToNot: Prefer `not_to` over `to_not`. (https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NotToNot)
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

Check failure on line 28 in spec/tasks/vagrant_spec.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 7.24, Ruby Ver: 2.7)

Layout/TrailingEmptyLines: Final newline missing. (https://rubystyle.guide#newline-eof)

Check failure on line 28 in spec/tasks/vagrant_spec.rb

View workflow job for this annotation

GitHub Actions / Spec / Spec tests (Puppet: ~> 8.0, Ruby Ver: 3.2)

Layout/TrailingEmptyLines: Final newline missing. (https://rubystyle.guide#newline-eof)

0 comments on commit dcdde29

Please sign in to comment.