Skip to content

Commit

Permalink
add another acceptance test
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jun 22, 2018
1 parent 197f174 commit b88843e
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion spec/acceptance/class_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,40 @@
class { 'consul':
version => '1.0.5',
manage_service => true,
config_hash => {
'datacenter' => 'east-aws',
'node_name' => 'foobar',
'server' => true,
}
}
EOS

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

describe file('/opt/consul') do
it { should be_directory }
end

describe service('consul') do
it { should be_enabled }
end

describe command('consul version') do
its(:stdout) { should match %r{Consul v1.0.5} }
end

end
context 'default parameters' do
it 'should work with no errors based on the example' do
pp = <<-EOS
package { 'zip': ensure => present } ->
# Don't manage the service as it doesn't work well in docker
class { 'consul':
version => '1.1.0',
manage_service => true,
config_hash => {
'datacenter' => 'east-aws',
'data_dir' => '/opt/consul',
Expand All @@ -34,8 +68,9 @@ class { 'consul':
end

describe command('consul version') do
its(:stdout) { should match %r{Consul v1.0.5} }
its(:stdout) { should match %r{Consul v1.1.0} }
end

end

end

0 comments on commit b88843e

Please sign in to comment.