diff options
author | Ashley Penney <ashley.penney@puppetlabs.com> | 2013-07-09 16:06:03 -0400 |
---|---|---|
committer | Ashley Penney <ashley.penney@puppetlabs.com> | 2013-07-09 16:06:03 -0400 |
commit | b1bedbe26227680d47250e1f4c542384baa43982 (patch) | |
tree | d1602a5244a7e15676ae0e01573851cd559ebe0f /spec/system/class_spec.rb | |
parent | 19b140786a6483a02b96d60605dc257d3625d3b7 (diff) |
Improve the rspec-system tests, making sure we test for the package
being installed and the config file at least makes basic sense.
Diffstat (limited to 'spec/system/class_spec.rb')
-rw-r--r-- | spec/system/class_spec.rb | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/spec/system/class_spec.rb b/spec/system/class_spec.rb new file mode 100644 index 0000000..49dfc64 --- /dev/null +++ b/spec/system/class_spec.rb @@ -0,0 +1,39 @@ +require 'spec_helper_system' + +describe "ntp class:" do + context 'should run successfully' do + pp = "class { 'ntp': }" + + context puppet_apply(pp) do + its(:stderr) { should be_empty } + its(:exit_code) { should_not == 1 } + its(:refresh) { should be_nil } + its(:stderr) { should be_empty } + its(:exit_code) { should be_zero } + end + end + + context 'service_ensure => stopped:' do + pp = "class { 'ntp': service_ensure => stopped }" + + context puppet_apply(pp) do + its(:stderr) { should be_empty } + its(:exit_code) { should_not == 1 } + its(:refresh) { should be_nil } + its(:stderr) { should be_empty } + its(:exit_code) { should be_zero } + end + end + + context 'service_ensure => running:' do + pp = "class { 'ntp': service_ensure => running }" + + context puppet_apply(pp) do |r| + its(:stderr) { should be_empty } + its(:exit_code) { should_not == 1 } + its(:refresh) { should be_nil } + its(:stderr) { should be_empty } + its(:exit_code) { should be_zero } + end + end +end |