Skip to content

Commit

Permalink
added missing test for the provider
Browse files Browse the repository at this point in the history
  • Loading branch information
maxadamo committed Jan 9, 2025
1 parent 2198fb9 commit 52d0615
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions spec/acceptance/key_value.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,46 @@
# frozen_string_literal: true

require 'spec_helper_acceptance'

describe 'nomad class' do
context 'server with nomad_key_value declarations' do

Check failure on line 6 in spec/acceptance/key_value.rb

View workflow job for this annotation

GitHub Actions / Puppet / Static validations

RSpec/EmptyExampleGroup: Empty example group detected. (https://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/EmptyExampleGroup)
# failing on purpose on missing directories
pp = <<-MANIFEST
class { 'nomad':
config_hash => {
datacenter => 'ptk',
data_dir => "/var/lib/nomad",
extra_options => '-dev',
server => {
enabled => false,
bootstrap_expect => 1,
}
},
'acl' => {
'enabled' => false
},
'client' => {
'enabled' => false,
}
}
nomad_key_value { 'test/foo':
require => Class['nomad'],
value => {
'key1' => 'value1',
'key2' => 'value2',
},
}
nomad_key_value { 'test/bar':
ensure => absent;
require => Class['nomad'],
value => {
'key1' => 'value10',
},
}
MANIFEST

# Run it twice and test for idempotency
apply_manifest(pp, expect_failures: true)
apply_manifest(pp, catch_changes: true)
end
end

0 comments on commit 52d0615

Please sign in to comment.