From b1bedbe26227680d47250e1f4c542384baa43982 Mon Sep 17 00:00:00 2001 From: Ashley Penney Date: Tue, 9 Jul 2013 16:06:03 -0400 Subject: Improve the rspec-system tests, making sure we test for the package being installed and the config file at least makes basic sense. --- spec/system/basic_spec.rb | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) (limited to 'spec/system/basic_spec.rb') diff --git a/spec/system/basic_spec.rb b/spec/system/basic_spec.rb index 87fedd2..7b717a0 100644 --- a/spec/system/basic_spec.rb +++ b/spec/system/basic_spec.rb @@ -1,25 +1,13 @@ require 'spec_helper_system' -describe 'basic tests:' do - # Using puppet_apply as a subject - context puppet_apply 'notice("foo")' do - its(:stdout) { should =~ /foo/ } - its(:stderr) { should be_empty } - its(:exit_code) { should be_zero } - end - - # Using puppet_apply as a helper - it 'my class should work with no errors' do - pp = <<-EOS - class { 'ntp': } - EOS - - # Run it twice and test for idempotency - puppet_apply(pp) do |r| - r.exit_code.should_not == 1 - r.refresh - r.exit_code.should be_zero +# Here we put the more basic fundamental tests, ultra obvious stuff. +describe "basic tests:" do + context 'make sure we have copied the module across' do + # No point diagnosing any more if the module wasn't copied properly + context shell 'ls /etc/puppet/modules/ntp' do + its(:stdout) { should =~ /Modulefile/ } + its(:stderr) { should be_empty } + its(:exit_code) { should be_zero } end end end - -- cgit v1.2.3